5
src/glue/types.pir - internals bits to do with types
13
=item !have_exact_same_type
15
Takes two types and returns true if they match exactly (not accounting for any
16
subtyping relations, etc).
20
.sub '!have_exact_same_type'
24
# If they have equal address, obviously the same.
25
.local pmc t1meta, t2meta
28
eq_addr t1meta, t2meta, same
30
# If they are junctions, compare inside them recursively.
31
$I0 = isa t1, 'Junction'
32
unless $I0 goto not_junc
33
$I1 = isa t2, 'Junction'
34
unless $I0 == $I1 goto not_junc
37
j1 = t1.'eigenstates'()
38
j2 = t1.'eigenstates'()
42
if i >= max goto junc_loop_end
45
$I0 = '!have_exact_same_type'($P0, $P1)
46
unless $I0 goto not_same
59
.sub '&CREATE_HASH_FROM_LOW_LEVEL'
60
.param pmc storage :optional
61
unless null storage goto have_storage
62
storage = root_new ['parrot';'Hash']
64
$P0 = get_hll_global 'Hash'
66
setattribute $P0, '$!storage', storage
71
.sub '!Undef_to_False'
75
x = get_hll_global ['Bool'], 'False'
88
# vim: expandtab shiftwidth=4 ft=pir: