mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #306 from bovi/printf-optional
Make printf optional based on sprintf
This commit is contained in:
+7
-2
@@ -48,7 +48,12 @@ module Kernel
|
||||
args[0]
|
||||
end
|
||||
|
||||
def printf(*args)
|
||||
__printstr__(sprintf(*args))
|
||||
if Kernel.respond_to?(:sprintf)
|
||||
##
|
||||
# Invoke method +sprintf+ and pass +*args+ to it.
|
||||
# Pass return value to *print* of STDOUT.
|
||||
def printf(*args)
|
||||
__printstr__(sprintf(*args))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user