Skip to content

Instantly share code, notes, and snippets.

@davorb
Created October 19, 2011 15:29
Show Gist options
  • Save davorb/1298632 to your computer and use it in GitHub Desktop.
Save davorb/1298632 to your computer and use it in GitHub Desktop.
rubinius gcd
[davor@athena rubinius]\$ irb
rbx-head :001 > 3.methods
=> ["~", "**", "==", "div", "%", "inspect", "to_f", "-@", "divmod", "===", "<=", "to_s", "&", "<=>", "<", "quo", "|", ">", "coerce", "fdiv", "*", "^", "taint", "__marshal__", "+", "divide", "<<", "zero?", "size", "modulo", "-", "/", ">>", ">=", "untaint", "singleton_methods", "tainted?", "frozen?", "freeze", "dup", "to_int", "chr", "bits", "ord", "upto", "round", "next", "pred", "to_i", "ceil", "floor", "[]", "even?", "downto", "truncate", "succ", "integer?", "odd?", "times", "prec_f", "prec", "prec_i", "nonzero?", "+@", "redo_compare", "eql?", "remainder", "initialize_copy", "step", "abs", "between?", "__fixnum__", "__show__", "irb_binding", "kind_of?", "equal?", "public_methods", "__extend__", "instance_variables", "is_a?", "__send__", "instance_variable_get", "nil?", "clone", "__nil__", "singleton_class", "respond_to?", "extend", "__method__", "to_a", "hash", "__id__", "__instance_of__", "__instance_variable_get__", "instance_variable_set", "enum_for", "__instance_variable_set__", "object_id", "__instance_variables__", "instance_variable_defined?", "__instance_variable_defined_p__", "method", "instance_eval", "__respond_to_p__", "send", "instance_exec", "to_enum", "type", "instance_of?", "methods", "class", "private_methods", "__class__", "display", "tap", "protected_methods", "id", "=~"]
rbx-head :002 > 3.gcd 2
NoMethodError: undefined method `gcd' on 3:Fixnum.
from Kernel(Fixnum)#gcd (method_missing) at kernel/delta/kernel.rb:79
from { } in Object#irb_binding at (irb):2
from Rubinius::BlockEnvironment#call_on_instance at kernel/common/block_environment.rb:72
rbx-head :003 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment