D - opCall bug
- Mik Mifflin (17/17) Feb 19 2004 The following program doesn't compile:
- Andrew (11/16) Feb 19 2004 |
- davepermen (4/20) Feb 19 2004 you should be able to do that. done similar things yet..
- Andrew (7/9) Feb 20 2004 IC. Could you please explain some of the advantages and disadvantages of...
- Mik Mifflin (5/20) Feb 20 2004 I don't think the point is if anyone actually has a use for it, the poin...
- Andrew (4/24) Feb 20 2004 I completely understand that Mik. I simply wanted to expand my knowledge...
- Mik Mifflin (4/23) Feb 19 2004 I can in this instance, as I return a caller object.
- Manfred Nowak (5/6) Feb 19 2004 [...]
- Mik Mifflin (5/24) Feb 19 2004 A temporary workaround is '(c(x)(y))', with the extra parentheses. The
- Manfred Nowak (5/7) Feb 19 2004 This is a cool thing. I am searching for something like that in the thre...
The following program doesn't compile: class caller { caller opCall (out int i) { i = 10; return this; } } void main (char[][] args) { caller c = new caller; int x,y; c(x)(y); } It gives this error: opcall.d(11): declaration main.x is already defined Compiler bug? Or did I do something stupid? -- - Mik Mifflin
Feb 19 2004
In article <c133a2$1cun$1 digitaldaemon.com>, Mik Mifflin says...void main (char[][] args) { caller c = new caller; int x,y; c(x)(y); <<----: } || HERE I don't think you can chain a function or opCall in that manner... The following works fine... void main (char[][] args) { caller c = new caller; int x,y; c(x); c(y); }
Feb 19 2004
you should be able to do that. done similar things yet.. i'll have a closer look... uhm.. tomorrow.. "Andrew" <Andrew_member pathlink.com> schrieb im Newsbeitrag news:c13739$1jlt$1 digitaldaemon.com...In article <c133a2$1cun$1 digitaldaemon.com>, Mik Mifflin says...void main (char[][] args) { caller c = new caller; int x,y; c(x)(y); <<----: } || HERE I don't think you can chain a function or opCall in that manner... The following works fine... void main (char[][] args) { caller c = new caller; int x,y; c(x); c(y); }
Feb 19 2004
In article <c138s9$1n7c$1 digitaldaemon.com>, davepermen says...you should be able to do that. done similar things yet.. i'll have a closer look... uhm.. tomorrow..IC. Could you please explain some of the advantages and disadvantages of doing things this way? Other than being able to simultaneously assign a value to multiple variables, what are some other uses for this feature? Thanks, Andrew
Feb 20 2004
Andrew wrote:In article <c138s9$1n7c$1 digitaldaemon.com>, davepermen says...I don't think the point is if anyone actually has a use for it, the point is that it should work, and does not. -- - Mik Mifflinyou should be able to do that. done similar things yet.. i'll have a closer look... uhm.. tomorrow..IC. Could you please explain some of the advantages and disadvantages of doing things this way? Other than being able to simultaneously assign a value to multiple variables, what are some other uses for this feature? Thanks, Andrew
Feb 20 2004
In article <c15bp3$2k3l$1 digitaldaemon.com>, Mik Mifflin says...Andrew wrote:I completely understand that Mik. I simply wanted to expand my knowledge. Thanks anyhow. AndrewIn article <c138s9$1n7c$1 digitaldaemon.com>, davepermen says...I don't think the point is if anyone actually has a use for it, the point is that it should work, and does not. -- - Mik Mifflinyou should be able to do that. done similar things yet.. i'll have a closer look... uhm.. tomorrow..IC. Could you please explain some of the advantages and disadvantages of doing things this way? Other than being able to simultaneously assign a value to multiple variables, what are some other uses for this feature? Thanks, Andrew
Feb 20 2004
Andrew wrote:In article <c133a2$1cun$1 digitaldaemon.com>, Mik Mifflin says...I can in this instance, as I return a caller object. -- - Mik Mifflinvoid main (char[][] args) { caller c = new caller; int x,y; c(x)(y); <<----: } || HERE I don't think you can chain a function or opCall in that manner... The following works fine... void main (char[][] args) { caller c = new caller; int x,y; c(x); c(y); }
Feb 19 2004
Andrew wrote: [...]The following works fine...[...] However, a very misleading error message. So long.
Feb 19 2004
Mik Mifflin wrote:The following program doesn't compile: class caller { caller opCall (out int i) { i = 10; return this; } } void main (char[][] args) { caller c = new caller; int x,y; c(x)(y); } It gives this error: opcall.d(11): declaration main.x is already defined Compiler bug? Or did I do something stupid?A temporary workaround is '(c(x)(y))', with the extra parentheses. The error goes away and it works as expected.. -- - Mik Mifflin
Feb 19 2004
Mik Mifflin wrote:A temporary workaround is '(c(x)(y))', with the extra parentheses. The error goes away and it works as expected..This is a cool thing. I am searching for something like that in the thread `[experts] opComma'. `cast(void) c(x)(y)' also works. So long.
Feb 19 2004