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

Re: Empty hash

Thread Previous | Thread Next
From:
Stuart Cook
Date:
June 2, 2005 03:26
Subject:
Re: Empty hash
Message ID:
49b3510605060203253a16bb00@mail.gmail.com
On 6/1/05, Luke Palmer <lrpalmer@gmail.com> 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.


Stuart

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About