Skip to content

Commit

Permalink
fixed 'iso to work with dotted lists, fixed 'type to treat Sub and Mu…
Browse files Browse the repository at this point in the history
…ltiSub as 'fn
  • Loading branch information
stefano committed Aug 16, 2009
1 parent ba9260d commit 785d821
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
20 changes: 6 additions & 14 deletions builtins.pir
Expand Up @@ -221,24 +221,16 @@ no:

.local pmc nil
nil = get_hll_global 'nil'
loop:

$P0 = car(a)
$P1 = car(b)
$P2 = 'iso'($P0, $P1)
unless $P2 goto no
a = cdr(a)
b = cdr(b)
unless a goto nil_b
if b goto loop
goto no
nil_b:
if b goto no
goto yes
no:
if $P2 goto try_cdr
.return (nil)
yes:
$P0 = get_hll_global 't'
.return ($P0)
try_cdr:
$P0 = cdr(a)
$P1 = cdr(b)
.tailcall 'iso'($P0, $P1)
.end

.sub 'iso' :multi(_, _)
Expand Down
6 changes: 5 additions & 1 deletion types.pir
Expand Up @@ -440,10 +440,14 @@ type_err:
.param pmc what
$S0 = typeof what
if $S0 == 'Tagged' goto tagged
if $S0 == 'Sub' goto fn
if $S0 == 'MultiSub' goto fn
.tailcall 'intern'($S0)
tagged:
$P0 = what[0]
.return ($P0)
.return ($P0)
fn:
.tailcall 'intern'("fn")
.end

## coercion
Expand Down

0 comments on commit 785d821

Please sign in to comment.