るりまサーチ

最速Rubyリファレンスマニュアル検索!
77件ヒット [1-77件を表示] (0.134秒)
トップページ > クエリ:i[x] > クエリ:-[x] > クエリ:@[x] > クエリ:self[x] > クラス:RubyVM::InstructionSequence[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. ipaddr to_i

ライブラリ

キーワード

検索結果

RubyVM::InstructionSequence#inspect -> String (9323.0)

self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。

...
self
の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
i
seq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}

@
see RubyVM::InstructionSequence#labe...
...l,
RubyVM::InstructionSequence
#path...

RubyVM::InstructionSequence#disasm -> String (6223.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...
self
が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

puts RubyVM::InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1...
...( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave

@
see RubyVM::InstructionSequence.disasm...

RubyVM::InstructionSequence#disassemble -> String (6223.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...
self
が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

puts RubyVM::InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1...
...( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave

@
see RubyVM::InstructionSequence.disasm...

RubyVM::InstructionSequence#path -> String (3235.0)

self が表す命令シーケンスの相対パスを返します。

...
self
が表す命令シーケンスの相対パスを返します。

self
の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1...
...> <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq...
....path # => "method.rb"

@
see RubyVM::InstructionSequence#absolute_path...

RubyVM::InstructionSequence#absolute_path -> String | nil (3229.0)

self が表す命令シーケンスの絶対パスを返します。

...
self
が表す命令シーケンスの絶対パスを返します。

self
を文字列から作成していた場合は nil を返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
...
...=> nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"

@
see RubyVM::InstructionSequence#pat...

絞り込み条件を変える

RubyVM::InstructionSequence#label -> String (3229.0)

self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。

...
self
が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。

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

例1...
...:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, w...
...end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

RubyVM::InstructionSequence
.of(method(:hello)).label
# => "hello"

@
see RubyVM::InstructionSequence#base_label...

RubyVM::InstructionSequence#base_label -> String (3223.0)

self が表す命令シーケンスの基本ラベルを返します。

...
self
が表す命令シーケンスの基本ラベルを返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.base_label
# => "<compiled>"

例2: RubyVM::InstructionSequence.co...
...mpile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

RubyVM::Instruction...
...Sequence.of(method(:hello)).base_label
# => "hello"

@
see RubyVM::InstructionSequence#label...