(I'm going to RFC these if nobody presents any killer complaints about
them, it's just that writing RFCs is more work than I want to go through
for tiny little changes like these, especially if they turn out to be
dumb).

%hash in scalar context should return what scalar(keys(%hash))
currently does.

Resetting an each() should be done in some other way than calling
keys() or values().  Perhaps reset(%hash)?  I'm subfond of the current
reset() semantics (symbol table crackheadery + single-match regexp
resetting).

I was against the idea of hash context, but I'd love it if:

  foreach ($k,$v) (%hash) {
    ...
  }

and

  foreach ($k,$v) (sort %hash) {
    ...
  }

magically "worked".  Traversing hashes is so common, it'd be nice to
find a way around the keys() circumlocution.  The former is already
suggested, and I like it.  The latter requires the parser to
understand sort being passed a hash.

Nat
(just taught hashes in class, so I'm full of things that were hard to
justify)

Reply via email to