DMDScript - Put(...)
- bobef (7/7) Sep 06 2005 = calls Put() but += doesn't (or I miss something?). I tried all
- Walter Bright (4/11) Sep 08 2005 Check out the code in opcodes.d under IRaddass:, that's what gets execut...
= calls Put() but += doesn't (or I miss something?). I tried all verisions of Put()... Is there any other way to get notified when variable is modified by += operator. What I mean: var a=new mystuff; a=5; // I get notified, Put() is called a+=5; // nothing happens
Sep 06 2005
"bobef" <bobef lessequal.com> wrote in message news:dfl1nn$1pfq$1 digitaldaemon.com...= calls Put() but += doesn't (or I miss something?). I tried all verisions of Put()... Is there any other way to get notified when variable is modified by += operator. What I mean: var a=new mystuff; a=5; // I get notified, Put() is called a+=5; // nothing happensCheck out the code in opcodes.d under IRaddass:, that's what gets executed for a +=. Either putVnumber() or putVstring() is called.
Sep 08 2005
Walter Bright wrote:"bobef" <bobef lessequal.com> wrote in message news:dfl1nn$1pfq$1 digitaldaemon.com...Thank you, I'll check it out.= calls Put() but += doesn't (or I miss something?). I tried all verisions of Put()... Is there any other way to get notified when variable is modified by += operator. What I mean: var a=new mystuff; a=5; // I get notified, Put() is called a+=5; // nothing happensCheck out the code in opcodes.d under IRaddass:, that's what gets executed for a +=. Either putVnumber() or putVstring() is called.
Sep 09 2005
Adding this: Dobject o_o=b.toObject(); if(o_o) o_o.Put(s,v,0); after line 694 of opcodes.d seems to do the trick. I don't know if it is right to have zero for attributes and if it breaks something else but maybe time will tell (or Walter?). It is very nice because it could eliminate the need of setters/getters for certain functionality (like mywindow.setX() for example), which means less coding and less limitations, which is, I believe, cool. I don't know if it isn't against ECMA, but maybe it worths adding to the official distribution? bobef wrote:Walter Bright wrote:"bobef" <bobef lessequal.com> wrote in message news:dfl1nn$1pfq$1 digitaldaemon.com...Thank you, I'll check it out.= calls Put() but += doesn't (or I miss something?). I tried all verisions of Put()... Is there any other way to get notified when variable is modified by += operator. What I mean: var a=new mystuff; a=5; // I get notified, Put() is called a+=5; // nothing happensCheck out the code in opcodes.d under IRaddass:, that's what gets executed for a +=. Either putVnumber() or putVstring() is called.
Feb 19 2006