Uniform Function Call syntax for properties

2010-10-08 Thread Steven Schveighoffer
Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a getter on an int? i.e. int y = foo = 3; or int y = (3).foo; ??? I know arrays have an issue with property

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Stanislav Blinov
08.10.2010 16:55, Steven Schveighoffer пишет: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a getter on an int? i.e. int y = foo = 3; or int y = (3).foo;

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Denis Koroskin
On Fri, 08 Oct 2010 17:26:41 +0400, Stanislav Blinov wrote: 08.10.2010 16:55, Steven Schveighoffer пишет: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Steven Schveighoffer
On Fri, 08 Oct 2010 09:30:59 -0400, Denis Koroskin <2kor...@gmail.com> wrote: C# uses 'this' keyword for that purpose: @property int set(this int x, int y) { x = y; } @property int get(this const(int) x) { return x; } int a = 1; a.set(42); // a is 42 now 3.set(42); // fails to com

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Andrei Alexandrescu
On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a getter on an int? Good question. Andrei

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Stanislav Blinov
08.10.2010 17:46, Steven Schveighoffer пишет: On Fri, 08 Oct 2010 09:30:59 -0400, Denis Koroskin <2kor...@gmail.com> wrote: C# uses 'this' keyword for that purpose: @property int set(this int x, int y) { x = y; } @property int get(this const(int) x) { return x; } int a = 1; a.set

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.vj9cunrweav...@localhost.localdomain... > Someone was asking about UFC syntax for properties on d.learn, and I > realized, we have a huge ambiguity here. > > Given a function: > > @property int foo(int x) > > Is this a global setter or a getter on

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Jonathan M Davis
On Friday, October 08, 2010 13:56:14 Nick Sabalausky wrote: > "Steven Schveighoffer" wrote in message > news:op.vj9cunrweav...@localhost.localdomain... > > > Someone was asking about UFC syntax for properties on d.learn, and I > > realized, we have a huge ambiguity here. > > > > Given a function

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Nick Sabalausky
"Jonathan M Davis" wrote in message news:mailman.483.1286572389.858.digitalmar...@puremagic.com... > On Friday, October 08, 2010 13:56:14 Nick Sabalausky wrote: >> >> Additionally, with that understanding in place, this: >> >> @property void foo(int x) {...} >> (3).foo(); >> >> Is probably the o

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Steven Schveighoffer
On Fri, 08 Oct 2010 16:56:14 -0400, Nick Sabalausky wrote: Ugh, it seems D still doesn't quite understand the concept of a property. Here: @property int foo() // Obviously getter @property void foo(int x) // Obviously setter No other form makes any sence as a property. Frankly, I'm very su

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Andrei Alexandrescu
On 10/9/10 13:33 CDT, Steven Schveighoffer wrote: On Fri, 08 Oct 2010 16:56:14 -0400, Nick Sabalausky wrote: Ugh, it seems D still doesn't quite understand the concept of a property. Here: @property int foo() // Obviously getter @property void foo(int x) // Obviously setter No other form ma

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Andrei Alexandrescu
On 10/9/10 13:33 CDT, Steven Schveighoffer wrote: On Fri, 08 Oct 2010 16:56:14 -0400, Nick Sabalausky wrote: Ugh, it seems D still doesn't quite understand the concept of a property. Here: @property int foo() // Obviously getter @property void foo(int x) // Obviously setter No other form ma

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Denis Koroskin
On Sat, 09 Oct 2010 23:37:51 +0400, Andrei Alexandrescu wrote: On 10/9/10 13:33 CDT, Steven Schveighoffer wrote: On Fri, 08 Oct 2010 16:56:14 -0400, Nick Sabalausky wrote: Ugh, it seems D still doesn't quite understand the concept of a property. Here: @property int foo() // Obviously

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Sean Kelly
Andrei Alexandrescu wrote: > On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: >> Someone was asking about UFC syntax for properties on d.learn, and I >> realized, we have a huge ambiguity here. >> >> Given a function: >> >> @property int foo(int x) >> >> Is this a global setter or a getter on a

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Denis Koroskin
On Sun, 10 Oct 2010 00:09:23 +0400, Sean Kelly wrote: Andrei Alexandrescu wrote: On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is t

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Robert Jacques
On Sat, 09 Oct 2010 16:28:32 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 00:09:23 +0400, Sean Kelly wrote: Andrei Alexandrescu wrote: On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: Someone was asking about UFC syntax for properties on d.learn, and I realized,

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Denis Koroskin
On Sun, 10 Oct 2010 05:58:00 +0400, Robert Jacques wrote: On Sat, 09 Oct 2010 16:28:32 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 00:09:23 +0400, Sean Kelly wrote: Andrei Alexandrescu wrote: On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: Someone was ask

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Robert Jacques
On Sat, 09 Oct 2010 22:03:56 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 05:58:00 +0400, Robert Jacques wrote: On Sat, 09 Oct 2010 16:28:32 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 00:09:23 +0400, Sean Kelly wrote: Andrei Alexa

Re: Uniform Function Call syntax for properties

2010-10-09 Thread Denis Koroskin
On Sun, 10 Oct 2010 08:44:59 +0400, Robert Jacques wrote: On Sat, 09 Oct 2010 22:03:56 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 05:58:00 +0400, Robert Jacques wrote: On Sat, 09 Oct 2010 16:28:32 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 1

Re: Uniform Function Call syntax for properties

2010-10-10 Thread Robert Jacques
On Sun, 10 Oct 2010 00:58:39 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 08:44:59 +0400, Robert Jacques wrote: On Sat, 09 Oct 2010 22:03:56 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 05:58:00 +0400, Robert Jacques wrote: On Sat, 0

Re: Uniform Function Call syntax for properties

2010-10-13 Thread Steven Schveighoffer
On Sat, 09 Oct 2010 21:58:00 -0400, Robert Jacques wrote: On Sat, 09 Oct 2010 16:28:32 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 00:09:23 +0400, Sean Kelly wrote: Andrei Alexandrescu wrote: On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: Someone was ask

Re: Uniform Function Call syntax for properties

2010-10-13 Thread Robert Jacques
On Wed, 13 Oct 2010 14:34:14 -0400, Steven Schveighoffer wrote: On Sat, 09 Oct 2010 21:58:00 -0400, Robert Jacques wrote: On Sat, 09 Oct 2010 16:28:32 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 10 Oct 2010 00:09:23 +0400, Sean Kelly wrote: Andrei Alexandrescu wrote:

Re: Uniform Function Call syntax for properties

2010-10-14 Thread Steven Schveighoffer
On Wed, 13 Oct 2010 20:57:54 -0400, Robert Jacques wrote: On Wed, 13 Oct 2010 14:34:14 -0400, Steven Schveighoffer wrote: Because then we are back to writeln = 42; -Steve :) I see that despite not valid code for what, over a year now?, writeln = 42 still persists. IMO, that's becaus

Re: Uniform Function Call syntax for properties

2010-10-14 Thread Robert Jacques
On Thu, 14 Oct 2010 09:42:34 -0400, Steven Schveighoffer wrote: On Wed, 13 Oct 2010 20:57:54 -0400, Robert Jacques wrote: On Wed, 13 Oct 2010 14:34:14 -0400, Steven Schveighoffer wrote: Because then we are back to writeln = 42; -Steve :) I see that despite not valid code for what,

Re: Uniform Function Call syntax for properties

2010-10-14 Thread Steven Schveighoffer
On Thu, 14 Oct 2010 20:28:45 -0400, Robert Jacques wrote: First, to avoid confusion, I'd like to separate inappropriate usage at the binary level from textual/syntax level. For example, casting, compile-time reflection and .tupleof are all ways to circumvent the fundamental restrictions

Re: Uniform Function Call syntax for properties

2010-10-17 Thread Robert Jacques
On Thu, 14 Oct 2010 22:22:19 -0400, Steven Schveighoffer wrote: On Thu, 14 Oct 2010 20:28:45 -0400, Robert Jacques wrote: First, to avoid confusion, I'd like to separate inappropriate usage at the binary level from textual/syntax level. For example, casting, compile-time reflection an