|
|
# This implementation
def ===(other)
equal?(other) || self == other || object_id == other.object_id
end
# With this input
p ((2**29) - 1)
p 536870911
# Does this
15:17:08 ruerue@meow > shotgun/rubinius describe ../scratch/test.rb
Sexp:
[:block,
[:newline,
1,
"../scratch/test.rb",
[:fcall,
:p,
[:array,
[:call,
[:newline,
1,
"../scratch/test.rb",
[:call, [:lit, 2], :**, [:array, [:lit, 29]]]],
:-,
[:array, [:lit, 1]]]]]],
[:newline,
2,
"../scratch/test.rb",
[:fcall, :p, [:array, [:lit, 536870911]]]]]
Bytecode:
0000: meta_push_1
0001: push_int 29
0003: meta_push_2
0004: send_stack #, 1
0007: meta_send_op_minus
0008: push_self
0009: set_call_flags 1
0011: send_stack #, 1
0014: pop
0015: meta_push_neg_1
0016: push_self
0017: set_call_flags 1
0019: send_stack #, 1
0022: pop
0023: push_true
0024: sret
15:17:25 ruerue@meow >
|