Re: Making uniform function call syntax more complete a feature

2012-07-16 Thread Christophe Travert
Simen Kjaeraas , dans le message (digitalmars.D:172349), a écrit : On Thu, 12 Jul 2012 16:31:34 +0200, Christophe Travert trav...@phare.normalesup.org wrote: By the way, would it be possible to implement an opCmp that returns a double, to allow it to return a NaN ? That may allow to create

Re: Making uniform function call syntax more complete a feature

2012-07-14 Thread Simen Kjaeraas
On Thu, 12 Jul 2012 16:31:34 +0200, Christophe Travert trav...@phare.normalesup.org wrote: By the way, would it be possible to implement an opCmp that returns a double, to allow it to return a NaN ? That may allow to create values that are neither superior, nor inferior to other value, like

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Tommi
I posted this as an enhancement request over there: http://d.puremagic.com/issues/show_bug.cgi?id=8381

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Thiez
Have you considered adding operator overloading using UFCS while you're at it?

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Timon Gehr
On 07/12/2012 12:05 PM, Thiez wrote: Have you considered adding operator overloading using UFCS while you're at it? There is already an open issue about that iirc.

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Tommi
On Thursday, 12 July 2012 at 10:05:16 UTC, Thiez wrote: Have you considered adding operator overloading using UFCS while you're at it? I assumed it's already possible to add operators non-intrusively, because operators are just syntactic sugar for method calls: ++var; // actual

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Thiez
On Thursday, 12 July 2012 at 12:43:24 UTC, Tommi wrote: On Thursday, 12 July 2012 at 10:05:16 UTC, Thiez wrote: Have you considered adding operator overloading using UFCS while you're at it? I assumed it's already possible to add operators non-intrusively, because operators are just

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Tommi
On Thursday, 12 July 2012 at 13:19:00 UTC, Thiez wrote: It's already quite obvious that the compiler does not obey its own rewrite rules (see http://dlang.org/operatoroverloading.html#compare) Consider opCmp: a b is rewritten to a.opCmp(b) 0 or b.opCmp(a) 0 Let's assume the first rule

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Christophe Travert
Thiez , dans le message (digitalmars.D:172060), a écrit : Have you considered adding operator overloading using UFCS while you're at it? I assumed it's already possible to add operators non-intrusively, because operators are just syntactic sugar for method calls: ++var; //

Re: Making uniform function call syntax more complete a feature

2012-07-12 Thread Tommi
On Thursday, 12 July 2012 at 14:31:34 UTC, trav...@phare.normalesup.org (Christophe Travert) wrote: This behavior for opEquals is debatable, but make sense. I don't think it's debatable at all. You must be able to figure out how a class is going to behave just by looking at its definition.

Making uniform function call syntax more complete a feature

2012-06-17 Thread Tommi
As I see it, the goal of uniform function call syntax, as described here http://www.drdobbs.com/blogs/cpp/232700394, is to allow non-intrusively extending the functionality of a type. I think the current implementation comes short in accomplishing this goal on two accounts: 1) You can't

Re: Making uniform function call syntax more complete a feature

2012-06-17 Thread Jacob Carlborg
On 2012-06-17 08:39, Tommi wrote: As I see it, the goal of uniform function call syntax, as described here http://www.drdobbs.com/blogs/cpp/232700394, is to allow non-intrusively extending the functionality of a type. I think the current implementation comes short in accomplishing this goal on