Property discussion wrap-up

Maxim Fomin maxim at maxim-fomin.ru
Sun Jan 27 23:49:02 PST 2013


On Monday, 28 January 2013 at 07:17:56 UTC, Rob T wrote:
> On Monday, 28 January 2013 at 04:40:34 UTC, Andrei Alexandrescu 
> wrote:
>> I'm not convinced that's a bad thing. I've come to realize 
>> functions and variables _are_ different.
>
> The behavior of the variable seems to be a subset of what the 
> function does, i.e., they are both the exact same thing except 
> a function does not have a fixed implied implementation or a 
> fixed implied data store, and the variable is the smallest 
> reducible abstraction layer - provided that you do not dig any 
> deeper into the machine code implementation.

Variables and functions behaves very differently in storage, 
access, side effects, aliasing and many other criteria. Functions 
actually have fixed implementation as a part of executable/object 
file. Besides, D, as a system programming language, has limited 
opportunities to avoid low-level issues. The problem is that 
often there is need for some intermediate solution when only 
variable (only function) is not a satisfactory decision.

> I think the reason why removal of empty paren's enjoys a level 
> of favor, is because it removes a difference between a variable 
> and a function that serves only an artificial purpose instead 
> of a real one, thus removal is more of a relief than a burden.
>
> The edge case breakages happen where the assumed differences 
> between function and variable were depended on, so resolving 
> edge case problems really should be done at the high level 
> rather than at the low level otherwise we're not really fixing 
> anything, we're just shifting the complexity around, removing 
> it from one level and piling it back on at another level.
>
> --rt



More information about the Digitalmars-d mailing list