別のキーワード
種類
- インスタンスメソッド (88)
- 特異メソッド (77)
- 文書 (63)
クラス
- CSV (33)
- Enumerator (22)
-
OpenSSL
:: OCSP :: BasicResponse (11) -
Prime
:: TrialDivisionGenerator (22) -
REXML
:: Child (11) -
RubyVM
:: InstructionSequence (33) - StopIteration (11)
モジュール
- Psych (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - disasm (11)
- disassemble (11)
- filter (33)
- load (11)
-
next
_ values (11) - parse (11)
-
previous
_ sibling= (11) - result (11)
-
ruby 1
. 8 . 4 feature (11) - status (11)
- succ (11)
-
to
_ a (11) - 制御構造 (11)
検索結果
先頭5件
-
Prime
:: TrialDivisionGenerator # next -> Integer (24101.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
また内部的な列挙位置を進めます。 -
Enumerator
# next -> object (18149.0) -
「次」のオブジェクトを返します。
...。
列挙が既に最後へ到達している場合は、
StopIteration 例外を発生します。このとき列挙状態は変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。
next メソッドによる外部列挙の状態は他のイテレータメソ......ッドによる
内部列挙には影響を与えません。
ただし、 IO#each_line のようにおおもとの列挙メカニズムが副作用を
伴っている場合には影響があり得ます。
@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#......enum.next
end
# => 120
# 121
# 122
//}
//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte
begin
puts enum.next while true
rescue StopIteration
puts "iteration reached at end"
end
# => 120
# 121
# 122
# iteration reached at end
puts enum.next... -
REXML
:: Child # previous _ sibling=(other) (12206.0) -
other を self の前の隣接ノードとします。
...other を挿入します。
@param other 挿入するノード
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d
p a.to_s # => "<a><d/><b/><c/></a>"
//}... -
Prime
:: TrialDivisionGenerator # succ -> Integer (9001.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
また内部的な列挙位置を進めます。 -
Enumerator
# next _ values -> Array (6215.0) -
「次」のオブジェクトを配列で返します。
...を配列で返します。
Enumerator#next とほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。
このメソッドは、
yield
と
yield nil
を区別するために使えます。
next メソッドによる外部列挙の状...... IO#each_line のようにおおもとの列挙メカニズムが副作用を
伴っている場合には影響があり得ます。
//emlist[例: next と next_values の違いを][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next.......next
p e.next
p e.next
## yield args next_values next
# yield [] nil
# yield 1 [1] 1
# yield 1, 2 [1, 2] [1, 2]
# yield nil [nil] nil
# yield [1, 2] [[1, 2]] [1, 2]
//}
@raise StopIteratio... -
StopIteration
# result -> object (6018.0) -
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end
enumerator = object.to_enum
p enumerator.next #=> :yield1
p enumerator.next #=> :yield2
begin
enumerator.next
rescue StopIteration => error
p error.result #=> :each_returned
end... -
RubyVM
:: InstructionSequence # to _ a -> Array (6006.0) -
self の情報を 14 要素の配列にして返します。
...す。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバージョン。
: minor_version
命令シーケンスのマイナーバージョン。
: format_type
データ......。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]
より詳細な情報については、vm_core.h を参照。
: catch_table
例外や制御構造のオペレータ(rescue、next、redo、break など)の一覧......オペランドの配列の配列。
//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... -
RubyVM
:: InstructionSequence . disasm(body) -> String (6006.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...structionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。
@param body Proc、Method オブジェクトを指定します。
例1:Proc オブジェクトを指定した場合
# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequ......ence.disasm(p)
出力:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|----------------------------------------------------------......トを指定した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
puts RubyVM::InstructionSequence.disasm(method(:hello))
出力:
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8... -
RubyVM
:: InstructionSequence . disassemble(body) -> String (6006.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...structionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。
@param body Proc、Method オブジェクトを指定します。
例1:Proc オブジェクトを指定した場合
# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequ......ence.disasm(p)
出力:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|----------------------------------------------------------......トを指定した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
puts RubyVM::InstructionSequence.disasm(method(:hello))
出力:
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (438.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...(ChangeLogの
Tue Jun 5 16:15:58 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
に該当するようです)
: break and next [compat]
break, next は、引数を指定することでイテレータや yield の値を返す
ことができるようになりました。(この......クラ
スのインスタンスになりました。
=== クラス階層
: ((<File::Constants>))
File::Constants は、File クラスでなく IO クラスが include するように
なりました。((<ruby-dev:20964>))
: ((<UnboundMethod>)) [compat]
UnboundMethod クラスは Method......ror < NameError < StandardError.
: ((<Interrupt>)) [change]
Interrupt は、((<SignalException>))のサブクラスになりました。
(1.6以前はExceptionのサブクラス)
== 追加されたメソッド
=== 組み込み関数
: ((<組み込み関数/warn>)) [new]...