3 ms·
What's FreePascal's story with data structures? My only experience with Pascal has been really old-school Pascal, which is a pointers-and-explicit-allocation l
by david-given 10y ago
What's FreePascal's story with data structures?
My only experience with Pascal has been really old-school Pascal, which is a pointers-and-explicit-allocation language like C; if you want a map of things, you need to build one from scratch, track pointer lifetimes, remember to free stuff explicitly, etc.
Does FreePascal do better?
- analognoise 10y agoYou have the option to do it manually, of course - full power to the programmer! However... If you don't want to track pointer lifetimes, you can use interfaced objects, which are reference counted. There are tradeoffs there, but you get to choose them. The Lazarus IDE is setup out of the box to have debug builds include heaptrc - running your program in debug mode gives you a printout of anything you forgot to free. This is what I've been using. Do you have a particular example or data structure you're interested in? I'd be glad to help determine if FPC/Lazarus fits your use case.