On 22 August 2011 04:37, David G. Hong <david.g.h...@gmail.com> wrote:
> I think it is perfectly clear to everyone that, the purpose of this program > can be achieved without both `regex` and `eval`, thus rendering them > useless. The purpose of this program was to show that there is a general way to access all of the private variables in a closure in a safe way, without having to provide accessors for each variable. Yes, in most cases it would be *much* better to expose the variables via accessors, but my point was to show that there is another way. I wasn't saying we should use that way, just that it's possible, as a curiosity. To quote myself: "I'm not suggesting using it in production code, just thought it was a nice idea :)" [I think when people see `eval` a switch triggers in their brain and they go into survival mode] -- Nick Morgan http://skilldrick.co.uk @skilldrick Save our in-boxes! http://emailcharter.org -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com