るりまサーチ

最速Rubyリファレンスマニュアル検索!
35件ヒット [1-35件を表示] (0.045秒)
トップページ > モジュール:Kernel[x] > クエリ:_builtin[x] > クエリ:new[x] > クエリ:lambda[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Kernel.#lambda { ... } -> Proc (26340.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

....new に近い働きをします。


また、lambda に & 引数を渡すのは推奨されません。& 引数ではなくてブロック記法で記述する必要があります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
「warning: lambda...
...d; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next...
...all)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end

p foo().call #=> 1
//}

===[a:block] Proc オブジェク...
...ed; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
proc(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next]...

Kernel.#lambda -> Proc (26329.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...与えられたブロックから手続きオブジェクト (Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。

ブロックが指定されなければ、呼び出し元のメソッドで指定されたブロック
を手続きオブジェクトと...
...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...を指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生しま...

Kernel.#lambda { ... } -> Proc (26329.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...与えられたブロックから手続きオブジェクト (Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。

ブロックが指定されなければ、呼び出し元のメソッドで指定されたブロック
を手続きオブジェクトと...
...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...を指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生しま...

Kernel.#proc { ... } -> Proc (11240.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

....new に近い働きをします。


また、lambda に & 引数を渡すのは推奨されません。& 引数ではなくてブロック記法で記述する必要があります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
「warning: lambda...
...d; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next...
...all)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end

p foo().call #=> 1
//}

===[a:block] Proc オブジェク...
...ed; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
proc(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next]...

Kernel.#proc -> Proc (11229.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...与えられたブロックから手続きオブジェクト (Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。

ブロックが指定されなければ、呼び出し元のメソッドで指定されたブロック
を手続きオブジェクトと...
...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...を指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生しま...

絞り込み条件を変える

Kernel.#proc { ... } -> Proc (11229.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...与えられたブロックから手続きオブジェクト (Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。

ブロックが指定されなければ、呼び出し元のメソッドで指定されたブロック
を手続きオブジェクトと...
...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...を指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生しま...

Kernel.#proc -> Proc (11228.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...与えられたブロックから手続きオブジェクト (Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。

ブロックが指定されなければ、呼び出し元のメソッドで指定されたブロック
を手続きオブジェクトと...
...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...を指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生しま...

Kernel.#proc { ... } -> Proc (11228.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...与えられたブロックから手続きオブジェクト (Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。

ブロックが指定されなければ、呼び出し元のメソッドで指定されたブロック
を手続きオブジェクトと...
...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...を指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生しま...