Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol#to_proc returns a lambda Proc since 3.0.0 #2483

Merged
merged 1 commit into from
Mar 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions refm/api/src/_builtin/Symbol
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ self に対応する Proc オブジェクトを返します。
Proc#callの第一引数をレシーバとして、 self という名前のメソッドを
残りの引数を渡して呼びだします。

#@since 3.0.0
生成される Proc オブジェクトは lambda です。
#@samplecode
:object_id.to_proc.lambda? # => true
#@end
#@end

#@samplecode 明示的に呼ぶ例
:to_i.to_proc["ff", 16] # => 255 ← "ff".to_i(16)と同じ
#@end
Expand Down