るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.116秒)
トップページ > バージョン:2.3.0[x] > クエリ:l[x] > クエリ:on[x] > クエリ:instruction[x] > クエリ:eval[x]

別のキーワード

  1. optionparser on
  2. optparse on
  3. tracer on
  4. _builtin abort_on_exception
  5. thread abort_on_exception

検索結果

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

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

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

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

RubyVM::InstructionSequence.load_from_binary(binary) -> RubyVM::InstructionSequence (36919.0)

RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起こします。

他者により提供されたバイナリデータはロードすべきではありません。自分が変換したバイナリデータを使うべきです。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM:...