Sean O'Rourke skribis 2004-04-19 15:34 (-0700):
> I'm saying "division" is now defined such that when the numerator is
> a hash(-ref), the result is the set of values associated with the
> denominator. I've never tried to divide a hash or hashref by
> something without it being a bug.
I understand now. But that means the meaning of the / is unknown until
runtime, which means $foo/0 can't be a compile time error.
And it doesn't quote the thing after it, which means still doing a lot
of typing.
$foo/bar should be a compile time error (Perl 6 has no barewords) if
$foo is not a hashref, but be $foo{'bar'} if it is. Waiting for runtime
is bad, I think.
> /foo/ # trailing slash -- so it's a regexp (m/foo/)
> /foo\/bar/ # trailing slash -- syntax error (m/foo/ bar/)
> /foo/a # hash-path -- no trailing slash ($_.{'foo'}{'a'})
> /foo\/bar # hash-path -- no trailing slash ($_.{'foo/bar'})
> /foo\/ # hash-path -- no trailing slash ($_.{'foo/'})
Thanks. Now I'm sure I don't like the bare path idea. After a hash,
perhaps it's doable, and even "if -r /etc/passwd" is doable, but there
are too many allowed characters in filenames (on my system: any
character except \0 and /).
Juerd