In the new D release why use free functions instead of properties?

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 19 12:09:06 PDT 2014


On Tuesday, 19 August 2014 at 16:28:54 UTC, monarch_dodra wrote:
> Actually, the new free functions *are* properties. All that you 
> just declared is valid, but we never got around to doing it. 
> Walter (If I remember correctly) was opposed.
>
> So right now, even if "dup" is a free function, "myArray.dup()" 
> is still invalid.

Yuck. It shouldn't even be a breaking change to make them 
functions unless code is specifically testing dup vs dup(). We 
really should make that change IMHO.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list