From: "Damian Conway" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 18, 2000 12:56 AM
Subject: Re: implied pascal-like "with" or "express"
> Aha! How about this...which would give us your desired C<with>
functionality
> *and* solve a nagging problem with named arguments:
>
> Suppose C<with> were a built-in function with parameter list:
>
> sub with (\%; ^&) {...}
>
> If C<with> is called with *both* a hash and a block/sub ref/h.o.f. as
> arguments, it still converts the hash contents to a named list, but then
> invokes its second argument on that list of arguments. So:
[...]
> which works exactly as you want.
Well, not quite what /I/ want.  "What I want" is here defined to include the
ability to create new keys in the "with" hash by somthing as easy as
C<^meaning=42;>.  The proposed meaning of want wouldn't allow you to do
that, or the way I read this, even modify the value of existing keys.  While
this hardly makes it useless, it doesn't make it nearly as useful as it
could/should be.

Making the CODE(ref/HOF) parameter get aliases rather then values helps a
little, but not enough -- you still couldn't create new keys in the hash.

    -=- James Mastros

Reply via email to