るりまサーチ

最速Rubyリファレンスマニュアル検索!
285件ヒット [201-285件を表示] (0.030秒)
トップページ > クエリ:io[x] > クエリ:InstructionSequence[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each_line
  4. io readlines
  5. io each

検索結果

<< < 1 2 3 >>

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

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.load_from_binary_extra_data(binary) -> String (6018.0)

バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。

...埋め込まれたextra_dataを取り出します。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}

@see RubyVM::InstructionSequence#to_binary...

RubyVM::InstructionSequence#first_lineno -> Integer (6012.0)

self が表す命令シーケンスの 1 行目の行番号を返します。

...の 1 行目の行番号を返します。

例1:irb で実行した場合

RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1

例2:

# /tmp/method.rb
require "foo-library"
def foo
p :foo
end

RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2...

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

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

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

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

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

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

...ます。

: magic

データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。

: major_version

命令シーケンスのメジャーバージョン。

: minor_version

命令シーケンスのマイナーバージョン。

: format_type

デー...
...gs

引数の指定が必須のメソッド、ブロックの引数の個数。あるいは以下のよう
な配列。

[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]

より詳細な情報については、vm_cor...
...オペランドの配列の配列。


//emlist[例][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},
# "<c...

絞り込み条件を変える

NEWS for Ruby 2.0.0 (138.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...警告しなくなりました

=== 組み込みクラスの更新

* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO
にある同名のメソッドに対応します

* Array
* 追加: Array#bsearch 二分探索します
* 非互換:
* Array#shuf...
...に似ています
* 拡張: Hash#default_proc= default proc をクリアするために nil を渡せるようになりました

* IO
* 非推奨: IO#lines, #bytes, #chars, #codepoints

* Kernel
* 追加: Kernel.#Hash という変換メソッド。Kernel.#Array, Kernel.#Float に...
...加: Process#getsid session id を取得します(unix のみ)。

* Range
* 追加: Range#size サイズの遅延評価
* 追加: Range#bsearch 二分探索

* RubyVM (MRI specific)
* 追加: RubyVM::InstructionSequence.of to get the instruction sequence
from a method or a bl...

NEWS for Ruby 2.3.0 (126.0)

NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...うとして RuntimeError が発生したときにそのオブジェクトが生成された位置を表示します。
11725

* safe navigation operator (ぼっち演算子):
* object&.foo という形式のメソッド呼び出し形式が追加されました。これは object が ni...
...キュメントが追加されました
9098

=== 組み込みクラスの更新

* ARGF
* ARGF.read_nonblock は IO#read_nonblock と同じように `exception: false' オプションをサポートします
11358

* Array
* Array#bsearch_index を追加
10730
* Ar...
...close(Thread::Queue#close) を追加
10600

* Regexp/String: Unicode のバージョンを 7.0.0 から 8.0.0 に更新

* RubyVM::InstructionSequence
* 実験的な機能としてiseqローダー用の低レベルな操作をするメソッドをいくつか追加
使用例は s...

NEWS for Ruby 2.5.0 (54.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...非推奨になりました。C拡張のベースクラスでしたが、Rubyレベルに公開するのをやめました。3072

* Exception
* Exception#full_message を追加 14141 [実験的]
例外の文字列表現を取得します。その文字列は捕捉されない例外をRu...
...ンを指定するとテキストモードになります 13350
* File#path はFile::Constants::TMPFILE付きで開いたファイルに対して IOError を発生させます
13568
* File.stat, File.exist? など rb_stat() を使用しているメソッドではGVLを解放するよ...
.../Onigmo/issues/82
* Support new 5 emoji-related Unicode character properties

* RubyVM::InstructionSequence
* RubyVM::InstructionSequence#each_child を追加
* RubyVM::InstructionSequence#trace_points を追加

* String
* String#-@ はフリーズされていない文字列...

NEWS for Ruby 2.7.0 (24.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...omparable#clampや定数やDSLなどで便利かもしれません。
14799

//emlist[][ruby]{
ary[..3] # identical to ary[0..3]

case RUBY_VERSION
when ..."2.4" then puts "EOL"
# ...
end

age.clamp(..100)

where(sales: ..100)
//}

* 「$;」にnil以外の値を設定すると警告が出る...
...重代入でのrescue修飾子が単一の代入と同じ振る舞いになりました。 8279

//emlist[][ruby]{
a, b = raise rescue [1, 2]
# Previously parsed as: (a, b = raise) rescue [1, 2]
# Now parsed as: a, b = (raise rescue [1, 2])
//}

* 特異クラス構文での yield は警...
...昇しました。
詳細はhttps://github.com/ruby/ruby/pull/2583を
参照してください。

* RubyVM::InstructionSequence
* RubyVM::InstructionSequence#to_binaryメソッドは
コンパイルされたバイナリを生成します。
そのバイナリサイズ...
<< < 1 2 3 >>