Skip to content

Commit

Permalink
Make puts and friends return nil
Browse files Browse the repository at this point in the history
  • Loading branch information
joeri committed Aug 19, 2009
1 parent 3004f32 commit 686f030
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/builtins/say.pir
Expand Up @@ -18,19 +18,20 @@ builtin functions for Ruby.
print $P0
goto iter_loop
iter_end:
.return ()
$P0 = get_hll_global 'nil'
.return($P0)
.end

.sub 'puts'
.param pmc args :slurpy
$S0 = join "\n", args
'print'($S0, "\n")
.tailcall 'print'($S0, "\n")
.end

.sub 'p'
.param pmc args :slurpy
$S0 = join "\n", args
'print'($S0, "\n")
.tailcall 'print'($S0, "\n")
.end

.sub 'readline'
Expand All @@ -44,7 +45,7 @@ builtin functions for Ruby.
.param pmc fmt
.param pmc args :slurpy
$P0 = get_hll_global ['Kernel'], '!CARDINALMETA'
$P0.'printf'(fmt, args :flat)
.tailcall $P0.'printf'(fmt, args :flat)
.end

.sub 'sprintf'
Expand Down

0 comments on commit 686f030

Please sign in to comment.