I've been thinking about this in my sleep, and at the moment I think
I'd rather keep .foo meaning $_.foo, but break the automatic binding
of the invocant to $_.  Instead of that, I'd like to see a really,
really short alias for $self.  Suppose we pick "o" for that, short
for "object".  Then we get self calls of the form:

    o.frobme(...)

Now that has some interesting possibilities for variants.  We could
have

    c.bless(...)

which would presumably give you the class of the invocant.  Perhaps
more interestingly, if o and c are functions, then you can provide
arguments, with a default of 0.  So the above could really be short
for

    o(0).frobme(...)
    c(0).bless(...)

Now, we also have this other problem that we're forcing people to
name all the invocants for MMD methods, poor things.  But with
the above notation, the first invocant is o(0), the second invocant
is o(1), etc.  Not that we would encourage people to code this way,
but it'd be nice to have a way of getting at the actual args in
the same way we used to always get at them using @_.  (Such a notation
might well be useful in wrappers that don't know what they're being
wrapped around, such as various debugging wrappers.)

That's what Sleepy Brain says.  But Coffee Brain despises Sleepy Brain.  :-)

Larry

Reply via email to