First Draft: Turn properties into first class accessors
Dom DiSc
dominikus at scherkl.de
Wed Feb 5 14:16:06 UTC 2025
On Wednesday, 5 February 2025 at 02:39:18 UTC, 12345swordy wrote:
> https://docs.google.com/document/d/1bh-oho1vNpGpK7jaaBgitkV3fOY_but9oUQm5ObpQAQ/edit?usp=sharing
>
> Destroy!
This!
I just suggest to change (fix?) some wording:
"Currently properties are in a limbo state as the introduction of
compile time function evaluation (CTFE) has made the purpose of
properties redundant in the view of many programmers. However
this paper argues that the CTFE can not replace the purpose of
first class abstraction for types as it currently have the
following issues:"
"The common argument against properties is to make it part of a
library instead of a language feature."
"You can not take the address of the property (at least not
without using the traits via reflection)"
"It can not be passed as a function to a parameter/type (at least
not without using the traits system to obtain said function).
This is to make sure that it is used as the type that it is
abstracted for."
Additionally I would add something like:
"One important reason to provide properties as language feature
is to give the programmer more fine grained control over what can
be done with some member of a type (reading, writing, getting the
address)."
More information about the dip.development
mailing list