Skip to content

Instantly share code, notes, and snippets.

.sub uniq :method
.local pmc uarray, hash, val
.local int i, len
uarray = new 'CardinalArray'
hash = new 'CardinalHash'
i = 0
len = self.'Elems'()
a = [1,2,3]
puts a
a = a * 3
puts a
a = [1,2,3]
a = a * ":"
puts a
.sub 'infix:-' :multi('CardinalArray','CardinalArray')
.param pmc this
.param pmc that
.local pmc array, hash, key, includes
.local int i, len
array = new 'CardinalArray'
hash = new 'CardinalHash'
len = that.'size'()
i = 0
.sub uniq :method
.param pmc block :optional :named("!BLOCK")
.param int block_flag :opt_flag
.local pmc uarray, pair, hash, val, key, values
.local int i, len
uarray = new 'CardinalArray'
hash = new 'CardinalHash'
i = 0
Test statistics:
The test suite took 0:3.
563 tests were run, from 92 files.
500 tests passed, 26 of which were unexpected.
Unexpected passes were found in the following files:
proc.t
range.t
time.t
array/insert.t
integer/integer.t
.sub 'reverse' :method
.local pmc res
.local int i
res = new 'CardinalString'
.local pmc iterator, item
iterator = iter self
each_loop:
unless iterator goto each_loop_done
[23:11] [inara:/Users/treed/code/cardinal]% ../parrot/parrot test.pir
foo
1
set_string_native() not implemented in class 'String'
current instr.: 'main' pc 56 (test.pir:24)
.namespace ['CardinalException']
.sub 'onload' :anon :init :load
.local pmc excproto, core_type, hll_type, interp
excproto = newclass 'CardinalException'
$P0 = get_class 'CardinalObject'
addparent excproto, $P0
$P0 = get_class ['parrot';'Exception']
# The usual class setup stuff is combined with that of Object and Module.
# Look in src/builtins/classes.pir
.namespace ['Class';'meta']
.sub 'new' :method
.param pmc superclass :optional
.param int super_flag :opt_flag
if super_flag goto have_super
[22:48] [inara:/Users/treed/code/cardinal]% ./cardinal t/08-class.t
Method 'iterator' not found for invocant of class 'String'
current instr.: 'parrot;POST;Compiler;pir_children' pc 9663 (src/POST/Compiler.pir:70)
called from Sub 'parrot;POST;Compiler;pir_children' pc 9663 (src/POST/Compiler.pir:70)
... call repeated 4 times
called from Sub 'parrot;POST;Compiler;pir' pc 9945 (src/POST/Compiler.pir:212)
called from Sub 'parrot;POST;Compiler;pir_children' pc 9663 (src/POST/Compiler.pir:70)
... call repeated 2 times
called from Sub 'parrot;POST;Compiler;pir' pc 9945 (src/POST/Compiler.pir:212)
called from Sub 'parrot;POST;Compiler;pir_children' pc 9663 (src/POST/Compiler.pir:70)