Can you do this? (Forgive synatical errors; I'm a bit behind on this.)

  class Foo { has Code:( Str, Str --> Num ) &.somecode }

  my Foo $blah .= new :somecode{ $^x cmp $^y }
  my Int $x = 2;
  my Num $y = Inf;
  $blah.somecode( $x, $y );

Does construction of $blah fail because { $^x cmp $^y } doesn't have a
signature of :(Str, Str --> Num)? If not, does $blah.somecode($x, $y) fail
because of type mismatching? (Or is coercion attempted?) And would the
result of { $^x cmp $^y } be evaluated in numeric context? Or is the above
simply wrong?

Thanks in advance.

Postscript: It seems like a lot is happening on #perl6. It's so fast, and
often so divergent, that it would be extremely useful for some guy to
summarize what's happening on it regularly. A thought.

Reply via email to