> On Mar 9, 2018, at 10:32 AM, Michael Van Canneyt <mich...@freepascal.org> 
> wrote:
> 
> Why don't you use objects ? No-one has obsoleted this, and you get what you
> want: an object that can be allocated on the stack or on the heap.

Object is just for backwards compatibility right? Does it support new features 
like generics, helpers, overloads  etc…? I have read over the years they’ve 
been broken also so I just assumed they were a dead part of the compiler kept 
around for old projects. If they still worked then why introduce “advanced 
records” which are merely “basic classes”. :) As pointed out it doesn’t make 
sense that classes and records diverged in the way they did.

> 
> I'm sure that we can add some extension to it to get rid of the somewhat 
> awkward
> new(someobject,init)
> syntax to allocate one on the heap.

If they’re not dead, then yes, making objects more flexible is possible but 
making classes behave like records on the stack is not. The best we can do now 
is use management operators on generic records to wrap classes so they get 
deallocated when out of scope. I can’t believe how complicated we’ve made 
things. :)

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to