Re: @property on free function for UFCS?

2015-06-14 Thread Adam D. Ruppe via Digitalmars-d-learn
You can use @property there, but you don't have to because you can call it with optional parenthesis anyway.

Re: @property on free function for UFCS?

2015-06-14 Thread rcorre via Digitalmars-d-learn
On Sunday, 14 June 2015 at 12:36:43 UTC, Adam D. Ruppe wrote: You can use @property there, but you don't have to because you can call it with optional parenthesis anyway. Thanks. Is there a good reference for the current state of @property? I know it was hotly debated for awhile (and maybe

@property on free function for UFCS?

2015-06-14 Thread rcorre via Digitalmars-d-learn
Suppose I have a function defined like so: void foo(int i) { } intended to be called like: 5.foo Should it be labeled with @property? Or is @property only for true member functions?

Re: @property on free function for UFCS?

2015-06-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 14 June 2015 at 12:53:43 UTC, rcorre wrote: Is there a good reference for the current state of @property? Easy: it does absolutely nothing right now. I'm just never sure when I should be using it (if at all). You should really only use it when you know the function is

Re: @property on free function for UFCS?

2015-06-14 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 14 June 2015 at 12:53:43 UTC, rcorre wrote: Is there a good reference for the current state of @property? I know it was hotly debated for awhile (and maybe still is?). I'm just never sure when I should be using it (if at all). Oh yes:

Re: @property on free function for UFCS?

2015-06-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Jun 2015 12:26:52 +, rcorre wrote: Suppose I have a function defined like so: void foo(int i) { } intended to be called like: 5.foo Should it be labeled with @property? Or is @property only for true member functions? only if you plan to use it like `foo = 5;`. i.e.

Re: @property on free function for UFCS?

2015-06-14 Thread ketmar via Digitalmars-d-learn
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(){

Re: @property on free function for UFCS?

2015-06-14 Thread Timon Gehr via Digitalmars-d-learn
On 06/14/2015 05:50 PM, ketmar wrote: On Sun, 14 Jun 2015 12:26:52 +, rcorre wrote: Suppose I have a function defined like so: void foo(int i) { } intended to be called like: 5.foo Should it be labeled with @property? Or is @property only for true member functions? only if you plan