On Sun, 14 Jun 2015 18:21:39 +0200, Timon Gehr wrote: >> only if you plan to use it like `foo = 5;`. > > You can use it like that anyway.
sure, but i'm talking about style, not about compiler demands. >> i.e. exactly like field variable. > > struct S{ > void delegate() dg; > } > > int main(){ > S s; > s.dg=(){ writeln("!"); }; > s.dg(); > } > > Now show me the UFCS way. i'm afraid i didn't understood you here. >> compiler will not complain, but putting `@property` here is >> stylistically wrong. >> > It's neither wrong nor right. yet i never saw this: struct S { int n; } S s; s.n(42); the whole concept of properties (not bolted into the compiler yet) is to emulate *fields*. so it's stylistically right to declare something as a property if one wants to use it like `foo = 42;`. that means `mymodule.foo = 42;` actually. yet `42.foo` means `42.module.foo`, which even looks wrong.
signature.asc
Description: PGP signature