Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make printf optional based on sprintf

  • Loading branch information...
commit 2436ee817adfca3de7b758fa83f959d4079f134f 1 parent d105ea4
@bovi bovi authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 mrblib/print.rb
View
9 mrblib/print.rb
@@ -48,7 +48,12 @@ def p(*args)
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
Please sign in to comment.
Something went wrong with that request. Please try again.