るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.014秒)
トップページ > クラス:RubyVM::InstructionSequence[x] > クエリ:compile[x] > クエリ:eval[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. mkmf try_compile
  2. ripper compile_error
  3. _builtin compile
  4. kernel try_compile
  5. regexp compile

ライブラリ

検索結果

RubyVM::InstructionSequence#eval -> object (18115.0)

self の命令シーケンスを評価してその結果を返します。

...self の命令シーケンスを評価してその結果を返します。

RubyVM::InstructionSequence
.compile("1 + 2").eval # => 3...

RubyVM::InstructionSequence#to_a -> Array (14.0)

self の情報を 14 要素の配列にして返します。

...ベル。トップレベルでは "<main>"。文字列から作成していた場合は
"<compiled>"。

: #path

命令シーケンスの相対パス。文字列から作成していた場合は "<compiled>"。

: #absolute_path

命令シーケンスの絶対パス。文字列から作成し...
...シーケンスの 1 行目の行番号。

: type

命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main、
:defined_guard のいずれか。

: locals

全ての引数名、ローカル変数名からなる Symbol の配列。

: args

...
...][ruby]{
require 'pp'

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<compiled>",
# "<compiled>",
# nil,
# 1,
# :top,
# [:...