develooper Front page | perl.perl6.language | Postings from June 2005

Re: Empty hash

Thread Previous | Thread Next
Stuart Cook
June 2, 2005 03:26
Re: Empty hash
Message ID:
On 6/1/05, Luke Palmer <> wrote:
> Should {} be an empty hash rather than an empty code?

Given that an empty hashref is probably much more useful than an empty
block, I propose that {} be an empty hash and {;} be an empty block.

This mirrors the fact that (AFAIK) { $_ => 1 } is a hash and { $_ =>
1; } is a block.

Alternatively, it could be a special hash that can also be called (and
which does nothing), but I doubt that's useful or desirable.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About