On Tue, Oct 27, 2009 at 8:02 AM, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote: > Aside from that: do you have a trick up your sleeve for how to > scope UNIVERSAL monkeypatches lexically? Given an alternate universe where all Perl types are "Magic" and look up all of their operations in a per-type table (perhaps a Perl that uses Parrot Magic Cookies, if they still exist -- this is quite a stale rant I'm dusting off here) it might be possible to lexically or locally (lexically == do something with compile time effects within a block; locally == do something with run-time effects and simultaneously schedule the un-doing of that something at block exit time) Closer to reality, if plain data was treated more like overloaded objects, such tricks would become more possible. Although LEXICALLY rather than LOCALLY would be tricky, the compilation phase would need to catch the possibility or compile to an ops including the alternate case either as something to check for and catch or as the handler in the table. Moving stuff from late-bound to earlier-bound is certain to have some kind of very subtle effect by breaking things that use late binding, which as a class of things are themselves tricky. Extra points will be awarded for restating that using even more words.Thread Previous | Thread Next