Mailing lists / fpc-devel / 2015-08
Records nesting/inheritance?
5 messages · 3 people ·
- ЧЧернов Дмитрий 3
- MMichael Van Canneyt 1
- SSven Barth 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
"Чернов Дмитрий" wroteSo, there's examples of addressing some fields with and without this
feature:
Show quoted text 8 lines
Of course, but probably not the objects you think about ("class"), but their older cousins ("object"). ;)
But never mind that a) in procedural programming we don't use objects,
"object" types behave like records with inheritance if they don't have methods.
b) objects are more complex that needed
Not true for "object" types.
c) objects require additional routines for creating and destroying of
them.
Like records "object" types can be allocated on the stack.
So there is no need to burden "record" with another feature that's already supported by "object".
Note: Multiple inheritance is however supported by none of the three structured types ("record", "object", "class") and it wouldn't be added anyway, so there you need to find a solution with normal inheritance.
Regards,
Sven
Чернов Дмитрий wrote 12 lines
You can do this already with extended records, just declare properties.
http://www.freepascal.org/docs-html/ref/refse51.html#x107-1170009.1
Michael.
05.08.2015, 16:20, "Michael Van Canneyt" :
Show quoted text 25 lines
You can do this already with extended records, just declare properties.…
