Automatic coercion and context

2006-09-30 Thread Joshua Choi
completely off the mark?) Joshua Choi

On signatured code attributes of a class

2006-04-06 Thread 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

Context and coercion

2006-04-03 Thread Joshua Choi
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

Multisubs and multimethods: what's the difference?

2006-03-01 Thread Joshua Choi
sub" or "method"; why not just "multi" or something? Surely there won't be multirules, multimacros, etc. Right? Thanks to all, Joshua Choi

Symbolic references and twigils

2006-01-21 Thread 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

=>'s autoquoted identifiers

2005-11-17 Thread Joshua Choi
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