以下の内容はhttps://shuzo-kino.hateblo.jp/entry/2014/10/29/234103より取得しました。


可変変数の場合におけるprocとlambdaの差

可変変数の場合においては、procよりlambdaの方が変数チェックが厳密です

procの場合

hoge = proc {|x, *w| (x||0) + w.inject(0,&:+)}

hoge.curry(0)[1,2,3]
=> 6

lambdaの場合

hoge = lambda {|x, *w| (x||0) + w.inject(0,&:+)}

hoge.curry(0)[1,2,3]
##ArgumentError: wrong number of arguments (0 for 1+)



以上の内容はhttps://shuzo-kino.hateblo.jp/entry/2014/10/29/234103より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14