Steffen Mueller
> >   %hash4 = ("Something", "mixing", pairs => and, "scalars");
>                    1           2        3      4       5
> Perl5 says "Odd number of elements in hash assignment at -e line 1."
> And Perl6 should, too.

Hmm, I rather like the idea of thinking of a %foo variable as a set, not a
map: a map is a set of pairs; with an equivalence class based on the first
of the pair. But I'm not sure if that way of thinking can work in Perl6. if
%set_of_ints is assigned a set of ints, it should return a list of ints, not
a list of pairs. But if it's a map with some DWIM for assignment from lists
of ints, then it would return a list of pairs. Perhaps I need declarations
like:

  my %foo is set; # a set: $foo{bar} returns a boolean
  my %foo is set(int); # set of ints
  my %foo is hash; #default
  my %foo is hash(int, any); # hash whose keys must be ints
  my %foo is hash(string is equiv_class{lc $^a}, any); # case insensitive
string keys

I've just reviewed A2: it doesn't seem to say much about this stuff.

Dave.

Reply via email to