26件ヒット
[1-26件を表示]
(0.031秒)
別のキーワード
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) - 制御構造 (11)
検索結果
先頭3件
-
debug (38018.0)
-
Ruby デバッガです。Ruby スクリプトのソースコードデバッグに使用します。
...したインタフェース rubydb3x.el が
https://github.com/ruby/elisp にあるので、活用してください。
=== 使い方
$ ruby -rdebug foo.rb
または、Emacs から
M-x load-library rubydb3x.el
M-x rubydb
=== デバッグコマンド
以下は、デバッガで使用......。
ここに挙げたもの以外を入力した場合、その入力を ruby の式として評価します。
: break
: break [<file>:]<position>|<class>:<method>
ブレークポイントを設定します。引数を省略した場合設定したブレークポ
イントを表示しま......指定した行数分、処理を
続行します。メソッドの中に入ります。
このコマンドの省略形は s です。
: next [nnn]
一行ずつ処理を実行します。引数を指定した場合、指定した行数分、処理を
続行します。step [nnn]と... -
制御構造 (112.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...制御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END
Rubyでは(Cなどとは異なり)制御構造は式であ......に
//emlist[][ruby]{
$_ =~ リテラル
//}
であるかのように評価されます。
==== if 修飾子
//emlist[例][ruby]{
print "debug\n" if $DEBUG
//}
文法:
式 if 式
右辺の条件が成立する時に、左辺の式を評価してその結果を返します。
条件......トの各要素に対して本体を繰り返し
て実行します。これは以下の式とほぼ等価です。
(式1).each `{' `|' lhs..`|' 式2.. `}'
「ほぼ」というのは、do ... endまたは{ }による
ブロックは新しいローカル変数の有効範囲を導入... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>......!
* String#slice / String#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ / String#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase
* Symbol
* Symbol#to_proc now returns a lambda Proc. 162......ault gems
* The following libraries are promoted to default gems from stdlib.
* English
* abbrev
* base64
* drb
* debug
* erb
* find
* net-ftp
* net-http
* net-imap
* net-protocol
* open-uri
* optparse
* pp...