Re: What's the status of old-style operator overloads in D2?

2014-04-23 Thread bearophile via Digitalmars-d
Jacob Carlborg: I believe that for aliasing function pointers only the latter syntax works. It's a bug that needs to be fixed before the deprecation of old style alias syntax... Bye, bearophile

Re: What's the status of old-style operator overloads in D2?

2014-04-23 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 22 Apr 2014 18:54:41 -0400, Meta wrote: On Tuesday, 22 April 2014 at 21:35:31 UTC, Meta wrote: Does this work if test is in a different module from main? struct test { private int opBinary(string op: "*")(test other) { return 3; } public alias opMul = opBinary!"*"; }

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Jacob Carlborg via Digitalmars-d
On 22/04/14 20:06, Brian Schott wrote: We have "alias a = b;" and "alias b a;", so there's precedent for having two ways of doing exactly the same thing. I believe that for aliasing function pointers only the latter syntax works. -- /Jacob Carlborg

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Meta via Digitalmars-d
On Tuesday, 22 April 2014 at 21:35:31 UTC, Meta wrote: Does this work if test is in a different module from main? struct test { private int opBinary(string op: "*")(test other) { return 3; } public alias opMul = opBinary!"*"; } void main() { test t1 = test(); tes

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Meta via Digitalmars-d
On Tuesday, 22 April 2014 at 15:50:21 UTC, Daniel Murphy wrote: "Andrej Mitrovic" wrote in message news:ifghzjafvfqrqkhlp...@forum.dlang.org... Old-style operator overloads (such as opCom, opAnd, etc) have largely been superseded by new-style templated operator overloads (opUnary, opBinary,

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread bearophile via Digitalmars-d
Brian Schott: We have "alias a = b;" and "alias b a;", so there's precedent for having two ways of doing exactly the same thing. I've just filed a bug report: https://issues.dlang.org/show_bug.cgi?id=12615 Bye, bearophile

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Matt Soucy via Digitalmars-d
On 04/22/2014 02:06 PM, Brian Schott wrote: > On Tuesday, 22 April 2014 at 17:43:58 UTC, Daniel Murphy wrote: >> Of course we can. > > We have "alias a = b;" and "alias b a;", so there's precedent for having two > ways of doing exactly the same thing. Except that's another case of "we had one way

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 22 Apr 2014 14:15:21 -0400, Daniel Murphy wrote: "Steven Schveighoffer" wrote in message news:op.xeqcf3vbeav7ka@stevens-macbook-pro-2.local... If the old behavior can be exactly mimiced, I think we can get rid of the old behavior. Can != Should Sorry I misspoke. We *should*

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Daniel Murphy via Digitalmars-d
"Steven Schveighoffer" wrote in message news:op.xeqcf3vbeav7ka@stevens-macbook-pro-2.local... If the old behavior can be exactly mimiced, I think we can get rid of the old behavior. Can != Should Less code in the compiler, less complexity in the language. More complexity in user code.

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 22 Apr 2014 13:43:58 -0400, Daniel Murphy wrote: "bearophile" wrote in message news:pvkqreqswxwusojgp...@forum.dlang.org... you can't keep two different operator overloading systems in a language. Of course we can. If the old behavior can be exactly mimiced, I think we can get

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Brian Schott via Digitalmars-d
On Tuesday, 22 April 2014 at 17:43:58 UTC, Daniel Murphy wrote: Of course we can. We have "alias a = b;" and "alias b a;", so there's precedent for having two ways of doing exactly the same thing.

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Daniel Murphy via Digitalmars-d
"bearophile" wrote in message news:pvkqreqswxwusojgp...@forum.dlang.org... you can't keep two different operator overloading systems in a language. Of course we can.

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread bearophile via Digitalmars-d
Daniel Murphy: I prefer the old ones mainly because You can't remove the new ones, and you can't keep two different operator overloading systems in a language. Bye, bearophile

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Daniel Murphy via Digitalmars-d
"Andrej Mitrovic" wrote in message news:ifghzjafvfqrqkhlp...@forum.dlang.org... Old-style operator overloads (such as opCom, opAnd, etc) have largely been superseded by new-style templated operator overloads (opUnary, opBinary, etc). I prefer the old ones mainly because the names are better

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 22 Apr 2014 10:21:40 -0400, Andrej Mitrovic wrote: Old-style operator overloads (such as opCom, opAnd, etc) have largely been superseded by new-style templated operator overloads (opUnary, opBinary, etc). But the old-style operators are not listed on the deprecation page, they

Re: What's the status of old-style operator overloads in D2?

2014-04-22 Thread monarch_dodra via Digitalmars-d
On Tuesday, 22 April 2014 at 14:21:42 UTC, Andrej Mitrovic wrote: this brought up some issues w.r.t. the compilation performance when using templates and potential object bloat as well. If templates are an issue, you can always just write a non-template function, and template the alias: ```D

What's the status of old-style operator overloads in D2?

2014-04-22 Thread Andrej Mitrovic via Digitalmars-d
Old-style operator overloads (such as opCom, opAnd, etc) have largely been superseded by new-style templated operator overloads (opUnary, opBinary, etc). But the old-style operators are not listed on the deprecation page, they don't seem to be planned to be deprecated/removed. I recall a few