summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-print/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-07-20 23:35:17 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-07-20 23:35:17 +0900
commitb1847721e8c53101dcec61cbccb154fba2381b59 (patch)
tree68a3fc6d65a2650441c5323318da08b9b6261f12 /mrbgems/mruby-print/mrblib
parentf0afdf74965aaacebca119a30f71a7d487ae6f9c (diff)
downloadmruby-b1847721e8c53101dcec61cbccb154fba2381b59.tar.gz
mruby-b1847721e8c53101dcec61cbccb154fba2381b59.zip
Implement `Kernel#print` and `Kernel#puts` in C.
Diffstat (limited to 'mrbgems/mruby-print/mrblib')
-rw-r--r--mrbgems/mruby-print/mrblib/print.rb31
1 files changed, 1 insertions, 30 deletions
diff --git a/mrbgems/mruby-print/mrblib/print.rb b/mrbgems/mruby-print/mrblib/print.rb
index cfe14a5e1..6383901ee 100644
--- a/mrbgems/mruby-print/mrblib/print.rb
+++ b/mrbgems/mruby-print/mrblib/print.rb
@@ -4,38 +4,9 @@
# ISO 15.3.1
module Kernel
##
- # Invoke method +print+ on STDOUT and passing +*args+
- #
- # ISO 15.3.1.2.10
- def print(*args)
- i = 0
- len = args.size
- while i < len
- __printstr__ args[i].to_s
- i += 1
- end
- end
-
- ##
- # Invoke method +puts+ on STDOUT and passing +*args*+
- #
- # ISO 15.3.1.2.11
- def puts(*args)
- i = 0
- len = args.size
- while i < len
- s = args[i].to_s
- __printstr__ s
- __printstr__ "\n" if (s[-1] != "\n")
- i += 1
- end
- __printstr__ "\n" if len == 0
- nil
- end
-
- ##
# Print human readable object description
#
+ # ISO 15.3.1.2.9
# ISO 15.3.1.3.34
def p(*args)
i = 0