Re: Uniform call syntax for implicit this.

2011-02-03 Thread Robert Jacques
On Thu, 03 Feb 2011 13:42:30 -0500, Jonathan M Davis wrote: On Thursday, February 03, 2011 09:54:44 Michel Fortin wrote: On 2011-02-03 12:43:12 -0500, Daniel Gibson said: > Am 03.02.2011 15:57, schrieb Michel Fortin: >> On 2011-02-02 23:48:15 -0500, %u said: >>> When implemented, will un

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Michel Fortin
On 2011-02-03 14:47:26 -0500, Jonathan M Davis said: I take it then that you're suggesting that the compiler automatically select the member function when the conflicting free function is a separate module? No, I haven't thought about that yet. That's one possibility, but it makes silent hi

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Michel Fortin
On 2011-02-03 15:50:17 -0500, spir said: How can you propose this, Michel? Complexify the language, and any implementation, just for a non-feature that makes code very hard to decode, by requiring a double mental rewriting operation: foo(i) --> this.foo(i) --> foo(this,i) what advantage

Re: Uniform call syntax for implicit this.

2011-02-03 Thread spir
On 02/03/2011 10:39 PM, Steven Schveighoffer wrote: On Thu, 03 Feb 2011 16:05:01 -0500, spir wrote: On 02/03/2011 08:43 PM, Steven Schveighoffer wrote: The more I think about it (and read discussions like this), the more I think that uniform call syntax should only be allowed for types which

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Steven Schveighoffer
On Thu, 03 Feb 2011 16:05:01 -0500, spir wrote: On 02/03/2011 08:43 PM, Steven Schveighoffer wrote: The more I think about it (and read discussions like this), the more I think that uniform call syntax should only be allowed for types which cannot declare member functions (arrays, primitive

Re: Uniform call syntax for implicit this.

2011-02-03 Thread spir
On 02/03/2011 08:43 PM, Steven Schveighoffer wrote: The more I think about it (and read discussions like this), the more I think that uniform call syntax should only be allowed for types which cannot declare member functions (arrays, primitives, enums, etc.). Otherwise, we introduce new ambiguit

Re: Uniform call syntax for implicit this.

2011-02-03 Thread spir
On 02/03/2011 08:15 PM, Michel Fortin wrote: On 2011-02-03 13:42:30 -0500, Jonathan M Davis said: Except that if you have both a member function foo and a free function foo, how can you tell the compiler which to use? Indeed, that's a problem. The solution is to sidestep the problem. :-)

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Jonathan M Davis
On Thursday, February 03, 2011 11:15:11 Michel Fortin wrote: > On 2011-02-03 13:42:30 -0500, Jonathan M Davis said: > > On Thursday, February 03, 2011 09:54:44 Michel Fortin wrote: > >> On 2011-02-03 12:43:12 -0500, Daniel Gibson said: > >>> Am 03.02.2011 15:57, schrieb Michel Fortin: > On 2

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Steven Schveighoffer
On Thu, 03 Feb 2011 14:15:11 -0500, Michel Fortin wrote: On 2011-02-03 13:42:30 -0500, Jonathan M Davis said: On Thursday, February 03, 2011 09:54:44 Michel Fortin wrote: On 2011-02-03 12:43:12 -0500, Daniel Gibson said: Am 03.02.2011 15:57, schrieb Michel Fortin: On 2011-02-02 23:4

Re: Uniform call syntax for implicit this.

2011-02-03 Thread bearophile
Michel Fortin: > We just have to disallow declaring a module-level function and a > class-level function with the same name and the same parameter types > (including 'this' in the parameters). No more special cases in D, please. Bye, bearophile

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Michel Fortin
On 2011-02-03 13:42:30 -0500, Jonathan M Davis said: On Thursday, February 03, 2011 09:54:44 Michel Fortin wrote: On 2011-02-03 12:43:12 -0500, Daniel Gibson said: Am 03.02.2011 15:57, schrieb Michel Fortin: On 2011-02-02 23:48:15 -0500, %u said: When implemented, will uniform call syntax

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Jonathan M Davis
On Thursday, February 03, 2011 09:54:44 Michel Fortin wrote: > On 2011-02-03 12:43:12 -0500, Daniel Gibson said: > > Am 03.02.2011 15:57, schrieb Michel Fortin: > >> On 2011-02-02 23:48:15 -0500, %u said: > >>> When implemented, will uniform call syntax work for the "this" > >>> object even if no

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Michel Fortin
On 2011-02-03 12:43:12 -0500, Daniel Gibson said: Am 03.02.2011 15:57, schrieb Michel Fortin: On 2011-02-02 23:48:15 -0500, %u said: When implemented, will uniform call syntax work for the "this" object even if not specified? For example, will foo() get called in the following example? vo

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Daniel Gibson
Am 03.02.2011 15:57, schrieb Michel Fortin: > On 2011-02-02 23:48:15 -0500, %u said: > >> When implemented, will uniform call syntax work for the "this" >> object even if not specified? >> >> For example, will foo() get called in the following example? >> >> void foo(A a, int b) {} >> >> class A

Re: Uniform call syntax for implicit this.

2011-02-03 Thread bearophile
%u: > When implemented, will uniform call syntax work for the "this" > object even if not specified? My impression of this situation is that uniform call syntax is a little syntax improvement that may cause big troubles. Bye, bearophile

Re: Uniform call syntax for implicit this.

2011-02-03 Thread Michel Fortin
On 2011-02-02 23:48:15 -0500, %u said: When implemented, will uniform call syntax work for the "this" object even if not specified? For example, will foo() get called in the following example? void foo(A a, int b) {} class A { void test() { this.foo(10); foo(10); } }

Re: Uniform call syntax for implicit this.

2011-02-03 Thread spir
On 02/03/2011 05:48 AM, %u wrote: When implemented, will uniform call syntax work for the "this" object even if not specified? For example, will foo() get called in the following example? void foo(A a, int b) {} class A { void test() { this.foo(10); foo(10); } } T

Re: Uniform call syntax for implicit this.

2011-02-02 Thread Jonathan M Davis
On Wednesday 02 February 2011 20:48:15 %u wrote: > When implemented, will uniform call syntax work for the "this" > object even if not specified? > > For example, will foo() get called in the following example? > > void foo(A a, int b) {} > > class A { > void test() { > this.foo(10);

Uniform call syntax for implicit this.

2011-02-02 Thread %u
When implemented, will uniform call syntax work for the "this" object even if not specified? For example, will foo() get called in the following example? void foo(A a, int b) {} class A { void test() { this.foo(10); foo(10); } } Thanks