Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## code class F def f puts 'f' end end class G < F def f super() end end G.new.f ## describe euler:rubinius brian$ bin/rbx describe super.rb Sexp: [:block, [:newline, 1, "super.rb", [:class, [:colon2, :F], nil, [:scope, [:newline, 2, "super.rb", [:defn, :f, [:scope, [:block, [:args], [:newline, 3, "super.rb", [:fcall, :puts, [:array, [:str, "f"]]]]], []]]], []]]], [:newline, 7, "super.rb", [:class, [:colon2, :G], [:const, :F], [:scope, [:newline, 8, "super.rb", [:defn, :f, [:scope, [:block, [:args], [:newline, 9, "super.rb", [:super]]], []]]], []]]], [:newline, 13, "super.rb", [:call, [:call, [:const, :G], :new], :f]]] Bytecode: 0000: push_nil 0001: open_class :F 0003: dup_top 0004: push_literal #<CompiledMethod:0x191 name=F file=super.rb> 0006: swap_stack 0007: attach_method :__class_init__ 0009: pop 0010: send_method #<SendSite:0x1b9 name=__class_init__ hits=0 misses=0> 0012: push_encloser 0013: pop 0014: push_const :F 0016: open_class :G 0018: dup_top 0019: push_literal #<CompiledMethod:0x1f1 name=G file=super.rb> 0021: swap_stack 0022: attach_method :__class_init__ 0024: pop 0025: send_method #<SendSite:0x219 name=__class_init__ hits=0 misses=0> 0027: push_encloser 0028: pop 0029: push_const :G 0031: send_method #<SendSite:0x241 name=new hits=0 misses=0> 0033: send_method #<SendSite:0x251 name=f hits=0 misses=0> 0035: pop 0036: push_true 0037: sret = F (0x191) ====================== 0000: push_self 0001: push_cpath_top 0002: find_const :Module 0004: push_self 0005: kind_of 0006: goto_if_true 10 0008: send_method #<SendSite:0x2b9 name=class hits=0 misses=0> 0010: set_encloser 0011: push_literal #<CompiledMethod:0x2d1 name=f file=super.rb> 0013: push_literal :f 0015: push_context 0016: send_stack #<SendSite:0x2f1 name=__add_method__ hits=0 misses=0>, 2 0019: sret = G (0x1f1) ====================== 0000: push_self 0001: push_cpath_top 0002: find_const :Module 0004: push_self 0005: kind_of 0006: goto_if_true 10 0008: send_method #<SendSite:0x349 name=class hits=0 misses=0> 0010: set_encloser 0011: push_literal #<CompiledMethod:0x361 name=f file=super.rb> 0013: push_literal :f 0015: push_context 0016: send_stack #<SendSite:0x381 name=__add_method__ hits=0 misses=0>, 2 0019: sret = f (0x2d1) ====================== 0000: check_argcount 0, 0 0003: push_literal "f" 0005: string_dup 0006: push_self 0007: set_call_flags 1 0009: send_stack #<SendSite:0x3d1 name=puts hits=0 misses=0>, 1 0012: sret = f (0x361) ====================== 0000: check_argcount 0, 0 0003: push_block 0004: send_super_stack_with_block#<SendSite:0x409 name=f hits=0 misses=0>, 0 0007: sret
This paste will be private.
From the Design Piracy series on my blog: