develooper Front page | perl.perl5.porters | Postings from October 2009

Re: [perl #70043] Re: [Sysadmins] Perl allows non-sensical operations on reference converted to an integer

Thread Previous | Thread Next
From:
David Nicol
Date:
October 27, 2009 06:39
Subject:
Re: [perl #70043] Re: [Sysadmins] Perl allows non-sensical operations on reference converted to an integer
Message ID:
934f64a20910270638s7dd9133co76cdf2fe90c3aafa@mail.gmail.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About