Graham Barr wrote:
> And what is wrong with
>   @a{@b} = ();
> which I use all the time. 

I use it too, because that's the perl5 idiom.  But what's "wrong" with
it is that you don't have a set on the LHS, you have some funky hash
slice thing, with both the hash AND the keys being assigned into it.

Have you read my RFC?  The essential problem with trying to use hashes
as sets (in perl5) is that sometimes it's the hash *variable* which is
the set, and sometimes it's the *set of keys* of the hash which is the
set, and most set-oriented operations have to use some klunky
combination of both views.

If the hash variable type had some method for accessing the set of keys
directly as a (pseudo)array, that would be one way to neatly solve the
problem. That's why I proposed the @%foo syntax.  But more python-like
syntaces are possible, if desired.

-- 
John Porter

All men are subjects.

Reply via email to