Recent

Author Topic: Numeric equivalent of TStringList?  (Read 3185 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 17104
  • Ceterum censeo Trump esse delendam
Re: Numeric equivalent of TStringList?
« Reply #15 on: February 27, 2022, 12:28:30 pm »
It would probably be a good excuse for me to look at generics, but I'm still a bit wary of them for anything which will eventually be put on Github etc.: while having a modern facility like that might be a good advert for FPC, insisting that the user upgrades to the latest version with no (lower-performance etc.) fallback if he's still on an older version isn't.

MarkMLl
Well, the packages are included in the rtl as fcl and rtl-generics, so that is maintained as long as there is Freepascal or the algorithms passed their sell by date. Quite often seen the latter in 40 years in the business.. Although the theory is still sound.
Generics usually (if not mostly or at all) have no speed penalty, so don't be afraid of them: they are resolved at parse time, not even at compile time.

But feel free to do it the OOP way and derive from classes.Tlist. Easy..
It also depends on the operations that you want: if there are not many, you can indeed use just an array (not recommended for convenience, though)
« Last Edit: February 27, 2022, 12:31:40 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8413
Re: Numeric equivalent of TStringList?
« Reply #16 on: February 27, 2022, 12:54:21 pm »
Well, the packages are included in the rtl as fcl and rtl-generics, so that is maintained as long as there is Freepascal or the algorithms passed their sell by date. Quite often seen the latter in 40 years in the business.. Although the theory is still sound.

rtl-generics appears at FPC 3.2.0. That means that e.g. anybody on Debian "Stable" should have it, but anybody on "Oldstable" won't... and I'd definitely call it a poor advert if I insisted that somebody upgraded before he had any change at all of compiling something.

Now, my preference is to compile FPC myself, so even the older systems here are candidates for having at least 3.0.4 (I've got a 32-bit laptop which I use for various things, Debian no longer ships the video driver which effectively pins its version). But considering that system, and considering a production (well-firewalled) system for which at one point I had to use an older compiler (because of ASound requirements, now fixed)... no, I'm really not happy demanding 3.2.0.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 17104
  • Ceterum censeo Trump esse delendam
Re: Numeric equivalent of TStringList?
« Reply #17 on: February 27, 2022, 01:38:16 pm »
rtl-generics appears at FPC 3.2.0. That means that e.g. anybody on Debian "Stable" should have it, but anybody on "Oldstable" won't... and I'd definitely call it a poor
Now, my preference is to compile FPC myself, so even the older systems here are candidates for having at least 3.0.4 (I've got a 32-bit laptop which I use for various things, Debian no longer ships the video driver which effectively pins its version). But considering that system, and considering a production (well-firewalled) system for which at one point I had to use an older compiler (because of ASound requirements, now fixed)... no, I'm really not happy demanding 3.2.0.

MarkMLl
Well, I am still happy with D7  ;D And 2006 and XE 10.1 but those were expensive except the latter..
Freepascal is free software and is well maintained. Some commercial options not quite so. With free software you can also update for free, but you are right that in the case of the commercial versions I still need D7. (because the development version of the compiler is and should be frozen in commercial settings)
But anything I can do in D7 (or higher) I do with FreePascal now. It is not only a matter of taste, but about two other things:
1. Is it stable
2. Does it fit my requirements

I don't have to work, but these two were always important to me.
Btw: I also compile the compiler myself, both current and trunk. And that goes for more than just FreePascal...
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018