Project

General

Profile

Bug #20974

Updated by alanwu (Alan Wu) 1 day ago

The following has had the same output since Ruby 1.9, when Proc#parameters was [introduced]: 


 ```ruby 
 p(proc     { |(_a)| }.parameters) # => [[:opt, nil]] 
 p(lambda { |(_a)| }.parameters) # => [[:req]] 
 ``` 

 I think they should be `[[:opt]]` and `[[:req]]` or `[[:opt, nil]]` and `[[:req, nil]]`. I prefer the nil-free option since that feels more anonymous.  

 [introduced]: [added]: https://docs.ruby-lang.org/en/master/NEWS/NEWS-1_9_2.html

Back