So, I went the route of passing in the context... after downloading the latest prototype.js version. It is working great and now I don't have to pass around all those arguments. Thanks everyone!
On May 28, 11:29 am, Jonathan Logue <[EMAIL PROTECTED]> wrote: > Wow - I left this thread thinking it was dead - boy was I wrong ;-) > Let me digest all that. I ended up just passing in anything I needed > from the this scope as arguments to the nested function call. I will > play around with these other approaches when I get some time. > > Thanks for the great info. > > On May 27, 12:48 pm, "Frederick Polgardy" <[EMAIL PROTECTED]> wrote: > > > > > Oh yeah, I think I remember seeing that this was added. It's fairly new in > > Prototype isn't it? > > > On Tue, May 27, 2008 at 2:01 PM, kangax <[EMAIL PROTECTED]> wrote: > > > > Moreover, #each (and most of enumerable methods) accepts "context" > > > object as a second argument - since this is such a common need. > > > > SomeComplexDataStructure.DataPart.each( function(DataPart) { > > > this.myRecursiveFunction(DataPart); > > > }, this ); > > > -- > > Science answers questions; philosophy questions answers.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---