Skip to content

Instantly share code, notes, and snippets.

@mufid
Created August 27, 2017 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mufid/879562a8a3d78f8b6ddc898a87cb0e80 to your computer and use it in GitHub Desktop.
Save mufid/879562a8a3d78f8b6ddc898a87cb0e80 to your computer and use it in GitHub Desktop.
[1] pry(main)> require 'pp'
=> false
[2] pry(main)> pp RubyVM::InstructionSequence.compile('["aku", "suka", "ini"]').to_a
["YARVInstructionSequence/SimpleDataFormat",
2,
3,
1,
{:arg_size=>0, :local_size=>0, :stack_max=>3},
"<compiled>",
"<compiled>",
nil,
1,
:top,
[],
{},
[],
[1,
[:trace, 1],
[:putstring, "aku"],
[:putstring, "suka"],
[:putstring, "ini"],
[:newarray, 3],
[:leave]]]
=> ["YARVInstructionSequence/SimpleDataFormat",
2,
3,
1,
{:arg_size=>0, :local_size=>0, :stack_max=>3},
"<compiled>",
"<compiled>",
nil,
1,
:top,
[],
{},
[],
[1, [:trace, 1], [:putstring, "aku"], [:putstring, "suka"], [:putstring, "ini"], [:newarray, 3], [:leave]]]
[3] pry(main)> pp RubyVM::InstructionSequence.compile('%w{aku suka ini}').to_a
["YARVInstructionSequence/SimpleDataFormat",
2,
3,
1,
{:arg_size=>0, :local_size=>0, :stack_max=>3},
"<compiled>",
"<compiled>",
nil,
1,
:top,
[],
{},
[],
[1,
[:trace, 1],
[:putstring, "aku"],
[:putstring, "suka"],
[:putstring, "ini"],
[:newarray, 3],
[:leave]]]
=> ["YARVInstructionSequence/SimpleDataFormat",
2,
3,
1,
{:arg_size=>0, :local_size=>0, :stack_max=>3},
"<compiled>",
"<compiled>",
nil,
1,
:top,
[],
{},
[],
[1, [:trace, 1], [:putstring, "aku"], [:putstring, "suka"], [:putstring, "ini"], [:newarray, 3], [:leave]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment