Commit 1d8456fe authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Drop initialization dependency from `mruby-print` to `mruby-sprintf`

In the old implementation, `Kernel#printf` raise error if `mruby-sprintf`
gem isn't specified before `mruby-print` gem. The new implementation
eliminates this ordering issue. This way is the same as `Kernel#printf` and
`IO#printf` in `mruby-io` gem.
parent 1f5a7f2f
......@@ -48,14 +48,8 @@ module Kernel
args.__svalue
end
unless Kernel.respond_to?(:sprintf)
def printf(*args)
raise NotImplementedError.new('printf not available')
end
else
def printf(*args)
__printstr__(sprintf(*args))
nil
end
def printf(*args)
__printstr__(sprintf(*args))
nil
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment