Skip to content

Instantly share code, notes, and snippets.

@koichiro
Created September 26, 2014 10:32
Show Gist options
  • Save koichiro/2ca82c9af0f5d1e1671f to your computer and use it in GitHub Desktop.
Save koichiro/2ca82c9af0f5d1e1671f to your computer and use it in GitHub Desktop.
koichiro@lordbritish ~ % ruby bc.rb to_sym.rb
#************************************************************
# to_sym.rb
# "hoge".to_sym
#
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putstring "hoge"
0004 opt_send_simple <callinfo!mid:to_sym, argc:0, ARGS_SKIP>
0006 leave
#************************************************************
koichiro@lordbritish ~ % ruby bc.rb str_sym.rb
#************************************************************
# str_sym.rb
# :"hoge"
#
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject :hoge
0004 leave
#************************************************************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment