[Prototype-core] Re: Error/counter-intuitive Class-inheritance?
Thats okay, although it is still not the intuitive way it should work? It's a little extra work defining many/all the variables again in the constructor, especially with several different classes inheriting from one. Anyways, everything else in prototype 1.6.0 is stunningly great. Keep up the good work. On Aug 20, 8:47 pm, Sam Stephenson <[EMAIL PROTECTED]> wrote: > On Aug 20, 2007, at 11:51 AM, Mislav Marohnić wrote: > > > You've been bitten by the fact the array is copied by reference, not > > by value. You should be setting the initial value for instance > > variables in the constructor:http://pastie.caboo.se/89338 > > > I'm not sure if this is something we should "fix" or not. In a way, > > the framework might deal with this situations in order to follow the > > POLS (principle of least surprise). We need to discuss this > > internally. > > > Anyway, do as I suggested for now. This might change in release 1.6.1. > > There is nothing to fix here. This is the exact problem that > constructors solve. I don't think it's surprising, and we won't be > changing it. > > -sam > > smime.p7s > 3KDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Error/counter-intuitive Class-inheritance?
On Aug 20, 2007, at 11:51 AM, Mislav Marohnić wrote: You've been bitten by the fact the array is copied by reference, not by value. You should be setting the initial value for instance variables in the constructor: http://pastie.caboo.se/89338 I'm not sure if this is something we should "fix" or not. In a way, the framework might deal with this situations in order to follow the POLS (principle of least surprise). We need to discuss this internally. Anyway, do as I suggested for now. This might change in release 1.6.1. There is nothing to fix here. This is the exact problem that constructors solve. I don't think it's surprising, and we won't be changing it. -sam smime.p7s Description: S/MIME cryptographic signature
[Prototype-core] Re: Error/counter-intuitive Class-inheritance?
On 8/20/07, Somebee <[EMAIL PROTECTED]> wrote: > > > When you push values into an array on an object, the values of the > class/prototype-array is also changed. You've been bitten by the fact the array is copied by reference, not by value. You should be setting the initial value for instance variables in the constructor: http://pastie.caboo.se/89338 I'm not sure if this is something we should "fix" or not. In a way, the framework might deal with this situations in order to follow the POLS (principle of least surprise). We need to discuss this internally. Anyway, do as I suggested for now. This might change in release 1.6.1. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Error/counter-intuitive Class-inheritance?
I understand that this sort-of becomes class-variables, but is there a way to define instance-variables without defining them in initialize? On Aug 20, 4:11 pm, Somebee <[EMAIL PROTECTED]> wrote: > When you push values into an array on an object, the values of the > class/prototype-array is also changed. > > http://pastie.caboo.se/89295<- example > > Is this how it is supposed to work? If so, it seems very odd and > counter-intuitive to me. > > Best Regards > Sindre --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---