Skip to content

Commit

Permalink
Fix a bunch of signatures constructed in PIR - they should mark their…
Browse files Browse the repository at this point in the history
… parameters as to be considered in the multi-dispatch also.
  • Loading branch information
jnthn committed Oct 8, 2009
1 parent 1ef2315 commit a67adbd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 27 deletions.
10 changes: 5 additions & 5 deletions src/classes/Array.pir
Expand Up @@ -48,7 +48,7 @@ Return true if the elements at C<indices> have been assigned to.
setprop block, "$!signature", signature
null $P1
$P0 = get_hll_global 'Array'
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "@indices", SIG_ELEM_SLURPY_POS, $P1, $P1, $P1, $P1
.end

Expand Down Expand Up @@ -101,7 +101,7 @@ Remove the last item from the array and return it.
setprop block, "$!signature", signature
$P0 = get_hll_global 'Array'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end


Expand Down Expand Up @@ -138,7 +138,7 @@ Add C<args> to the end of the Array.
setprop block, "$!signature", signature
null $P1
$P0 = get_hll_global 'Array'
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "@items", SIG_ELEM_SLURPY_POS, $P1, $P1, $P1, $P1
.end

Expand Down Expand Up @@ -167,7 +167,7 @@ Shift the first item off the array and return it.
setprop block, "$!signature", signature
$P0 = get_hll_global 'Array'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end


Expand Down Expand Up @@ -203,7 +203,7 @@ Adds C<args> to the beginning of the Array.
setprop block, "$!signature", signature
null $P1
$P0 = get_hll_global 'Array'
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "@items", SIG_ELEM_SLURPY_POS, $P1, $P1, $P1, $P1
.end

Expand Down
12 changes: 6 additions & 6 deletions src/classes/Hash.pir
Expand Up @@ -37,7 +37,7 @@ src/classes/Hash.pir - Perl 6 Hash class and related functions
setprop block, "$!signature", signature
$P0 = get_hll_global 'Hash'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "$topic", 0, $P1, $P1, $P1, $P1
.end

Expand All @@ -56,7 +56,7 @@ src/classes/Hash.pir - Perl 6 Hash class and related functions
setprop block, "$!signature", signature
$P0 = get_hll_global 'Hash'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "$key", 0, $P1, $P1, $P1, $P1
.end

Expand Down Expand Up @@ -86,7 +86,7 @@ src/classes/Hash.pir - Perl 6 Hash class and related functions
setprop block, "$!signature", signature
$P0 = get_hll_global 'Hash'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "@keys", SIG_ELEM_SLURPY_POS, $P1, $P1, $P1, $P1
.end

Expand All @@ -104,7 +104,7 @@ src/classes/Hash.pir - Perl 6 Hash class and related functions
setprop block, "$!signature", signature
$P0 = get_hll_global 'Hash'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "$key", 0, $P1, $P1, $P1, $P1
.end

Expand All @@ -120,7 +120,7 @@ src/classes/Hash.pir - Perl 6 Hash class and related functions
setprop block, "$!signature", signature
$P0 = get_hll_global 'Hash'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end

.namespace ['Perl6Hash']
Expand All @@ -135,7 +135,7 @@ src/classes/Hash.pir - Perl 6 Hash class and related functions
setprop block, "$!signature", signature
$P0 = get_hll_global 'Hash'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end

=back
Expand Down
2 changes: 1 addition & 1 deletion src/classes/List.pir
Expand Up @@ -273,7 +273,7 @@ Return the number of elements in the list.
setprop block, "$!signature", signature
$P0 = get_hll_global 'List'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
'!TOPERL6MULTISUB'(block)
.end
Expand Down
16 changes: 8 additions & 8 deletions src/classes/Mapping.pir
Expand Up @@ -79,8 +79,8 @@ every pair, joined by newlines or an explicitly given separator.
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "$format", 0, $P1, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 1, "$format", SIG_ELEM_MULTI_INVOCANT, $P1, $P1, $P1, $P1
set_signature_elem signature, 2, "$sep", SIG_ELEM_IS_OPTIONAL, $P1, $P1, $P1, $P1
'!TOPERL6MULTISUB'(block)
.end
Expand Down Expand Up @@ -121,7 +121,7 @@ every pair, joined by newlines or an explicitly given separator.
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
'!TOPERL6MULTISUB'(block)
.end

Expand Down Expand Up @@ -160,7 +160,7 @@ Returns keys of hash as a List
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end


Expand Down Expand Up @@ -202,7 +202,7 @@ Returns elements of hash as array of C<Pair(key, value)>
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end


Expand Down Expand Up @@ -234,7 +234,7 @@ Returns elements of hash as array of C<Pairs>
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
'!TOPERL6MULTISUB'(block)
.end

Expand Down Expand Up @@ -275,7 +275,7 @@ Returns elements of hash as array of C<Pairs>
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end


Expand Down Expand Up @@ -314,7 +314,7 @@ Returns values of hash as a List
setprop block, "$!signature", signature
$P0 = get_hll_global 'Mapping'
null $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT, $P0, $P1, $P1, $P1
set_signature_elem signature, 0, "self", SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT, $P0, $P1, $P1, $P1
.end

=back
Expand Down
15 changes: 8 additions & 7 deletions src/classes/Object.pir
Expand Up @@ -15,13 +15,14 @@ care of much of that.
=cut

# A few useful constants (just here so they're available going forward).
.const int SIG_ELEM_SLURPY_POS = 8
.const int SIG_ELEM_SLURPY = 56
.const int SIG_ELEM_INVOCANT = 64
.const int SIG_ELEM_MULTI_INVOCANT = 128
.const int SIG_ELEM_IS_RW = 256
.const int SIG_ELEM_IS_COPY = 512
.const int SIG_ELEM_IS_OPTIONAL = 2048
.const int SIG_ELEM_SLURPY_POS = 8
.const int SIG_ELEM_SLURPY = 56
.const int SIG_ELEM_INVOCANT = 64
.const int SIG_ELEM_MULTI_INVOCANT = 128
.const int SIG_ELEM_INVOCANT_AND_MULTI_INVOCANT = 192
.const int SIG_ELEM_IS_RW = 256
.const int SIG_ELEM_IS_COPY = 512
.const int SIG_ELEM_IS_OPTIONAL = 2048

=head2 Methods

Expand Down

0 comments on commit a67adbd

Please sign in to comment.