[fpc-pascal] Default properties wiki

Ben Grasset operator97 at gmail.com
Sat Dec 22 02:38:39 CET 2018


Nice! Very thorough. I think most of these are very useful.

On Tue, Dec 18, 2018 at 2:32 AM Ryan Joseph <ryan at thealchemistguild.com>
wrote:

> I decided to make a wiki going over all the details of default properties
> which I’ve covered so far, including various usage examples. There’s some
> questionable stuff in here and it’s actually a pretty complicated concept
> so I wanted to share it publicly.
>
> Some changes and things of interest:
>
> - While exploring the idea I’ve made it possible to enable multiple
> defaults because it’s trivial to just stop the search at the first default
> if it’s decided to make not sense. There’s some potential for multiple
> “implements” defaults properties to ease delegation which is interesting.
>
> - Because it’s technically possible default properties on array types are
> enabled. This makes it possible to index into an array wrapped in a record
> using [] syntax and for..in loops on the record itself without making an
> enumerator object.
>
> - For certain statements like if..then it’s possible to access the default
> property (for ordinal types like boolean). I think this is going to be
> helpful for nullable types in particular so it was added.
>
> - At the end I included some notes on technical details so you can easily
> find what changes I made in the compiler. I wasn’t sure at all how to
> implement this but this what I’ve arrived at as the best solution. Lots of
> cleanup required of course if we decided this is the correct way forward.
>
> http://wiki.freepascal.org/default_properties
>
> Regards,
>         Ryan Joseph
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20181221/9ce04885/attachment.html>


More information about the fpc-pascal mailing list