Skip to content

Commit

Permalink
define print and printf in mrblib
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 7, 2012
1 parent 32faeed commit 9bed29b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions mrblib/kernel.rb
Expand Up @@ -65,4 +65,29 @@ def loop #(&block)
def send(symbol, *args, &block) def send(symbol, *args, &block)
### *** TODO *** ### ### *** TODO *** ###
end end

##
# Print arguments
#
# ISO 15.3.1.2.10
def print(*args)
args.each do|x|
if x.nil?
__printstr__ "nil"
else
__printstr__ x.to_s
end
end
end

##
# Print arguments with newline
#
# ISO 15.3.1.2.11
def puts(*args)
args.each do|x|
__printstr__ x.to_s
__printstr__ "\n"
end
end
end end

0 comments on commit 9bed29b

Please sign in to comment.