Possible @property compromise
Jonathan M Davis
jmdavisProg at gmx.com
Tue Jan 29 18:29:01 PST 2013
On Tuesday, January 29, 2013 17:32:20 H. S. Teoh wrote:
> If this is the case, then I would have to say that @property is
> fundamentally broken. The whole point of @property is to make functions
> behave like variables, but if this "variable emulation" isn't even
> complete, then it defeats the purpose of having it in the first place.
It works if you can restrict a variable to a reasonable subset of its normal
operations (which primarily means that you can't take its address or pass it
by ref). You just can't fix that. Not with a systems language like D. Variables
and functions are just fundamentally different. C# manages it because you don't
have as much low-level control over variables (like taking their address). But
if we can do something like
struct S
{
@property int prop;
}
then that fixes the problem.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list