Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A bunch of multi-related changes. Perl6MultiSub is now mapped to Mult…
…i, so .WHAT works (spectest added, needs to make it into the specification but seems to have consensus on #perl6). Also defined .candidates, which has similar consensus, and .push which allows constructing a multi on-the-fly.
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## $Id$ | ||
|
||
=head1 TITLE | ||
|
||
Multi - Perl 6 multi-dispatch routine | ||
|
||
=head1 SUBROUTINES | ||
|
||
=over 4 | ||
|
||
=item onload() | ||
|
||
=cut | ||
|
||
.namespace [ 'Multi' ] | ||
|
||
.sub 'onload' :anon :init :load | ||
.local pmc p6meta, proto | ||
p6meta = get_hll_global ['Perl6Object'], '$!P6META' | ||
proto = p6meta.'new_class'('Multi', 'parent'=>'Perl6MultiSub Any') | ||
p6meta.'register'('Perl6MultiSub', 'parent'=>proto, 'protoobject'=>proto) | ||
.end | ||
|
||
.sub 'Scalar' :method | ||
.return (self) | ||
.end | ||
|
||
=back | ||
|
||
=cut | ||
|
||
# Local Variables: | ||
# mode: pir | ||
# fill-column: 100 | ||
# End: | ||
# vim: expandtab shiftwidth=4 ft=pir: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters