Sha256: 78d5cc2fffbdcd91b5011881aa450a30f6e92e0b3b3ff2216beadd77e05a2537

Contents?: true

Size: 1.08 KB

Versions: 33

Compression:

Stored size: 1.08 KB

Contents

##
# Kernel
#
# 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.3.34
  def p(*args)
    i = 0
    len = args.size
    while i < len
      __printstr__ args[i].inspect
      __printstr__ "\n"
      i += 1
    end
    args[0]
  end

  unless Kernel.respond_to?(:sprintf)
    def printf(*args)
      raise NotImplementedError.new('printf not available')
    end
    def sprintf(*args)
      raise NotImplementedError.new('sprintf not available')
    end
  else
    def printf(*args)
      __printstr__(sprintf(*args))
      nil
    end
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
script_core-0.0.6 ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb
script_core-0.0.5 ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.2.0 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.1.5 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.1.4 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.1.3 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.1.2 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.1.1 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.1.0 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.11 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.10 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.9 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.8 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.7 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.6 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.5 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.3 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
esruby-0.0.2 resources/mruby/mrbgems/mruby-print/mrblib/print.rb
script_core-0.0.4 ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb
script_core-0.0.3 ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb