5
src/classes/Associative.pir - Associative Role
9
Actually these days, Associative is defined in Perl 6 and this is
10
just a postcircumfix:<{ }> for non-Perl 6 types mapper.
14
=item !postcircumfix:<{ }>
16
Because foreign (non-Rakudo) Parrot objects generally won't
17
understand the "postcircumfix:<{ }>" method, we generate
18
postcircumfix as a private call to this function, and this
19
function then delegates to the appropriate method. In the
20
case we want a single value, then it just does the lookup;
21
otherwise, we rely on the method dispatches for the complex
22
cases looping back to here to get the one value.
27
.sub '!postcircumfix:<{ }>'
29
.param pmc args :optional
30
.param int has_args :opt_flag
32
$I0 = can invocant, 'postcircumfix:<{ }>'
33
if $I0 goto object_method
34
$I0 = isa invocant, 'Mu'
35
if $I0 goto object_method
37
$P0 = get_hll_global ['Associative[::T]'], 'postcircumfix:<{ }>'
38
unless has_args goto foreign_zen
39
$P1 = invocant.$P0(args)
45
unless has_args goto object_zen
46
$P1 = invocant.'postcircumfix:<{ }>'(args)
49
$P1 = invocant.'postcircumfix:<{ }>'()
61
# vim: expandtab shiftwidth=4 ft=pir: