completely off the mark?)
Joshua Choi
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 } d
Kudos to all on the Perl 6 mailing list,
What's the conceptual difference (or relationship) between context and type
coercion? Is
$moose.prefix:<~>
the same as
$moose.coerce:(Str)
for instance?
And forgive my brain, but how would you nicely define coercion in a class?
Like, could you spar
sub" or "method"; why not just "multi" or something? Surely there won't
be multirules, multimacros, etc. Right?
Thanks to all,
Joshua Choi
Supposed I wanted to refer to $.head using a symbolic reference--how
would I do it?
my $varname = 'head';
#1 say $.::($varname);
#2 say $::('.' ~ $varname);
#3 something else
te]
But what does that mean for =>'s signature? What type would be its
first parameter? Would you call it "&infix:{'=>'}:(Bareword | Any,
Any)" or something like that? And in any case, would you be able to
use this autoquoting in or as a sub, operator, type, etc.?
Thanks,
Joshua Choi