News for hackers. Stuff that matters.
Re:"Useless syntax sugar": Numbered block parameters in Ruby by inopinatus on Thursday October 12, 2023 @12:28AM (#37853495)
Fun fact, the arity of functions generated by Symbol#to_proc is not 1 but -2 (that is, additional arguments are passed through as well), so we can write stuff like

    module MissionControl
      #...
    
      [Proc, Method, Binding, UnboundMethod].each_with_object(self, &:include)
    end
if one were so inclined.
Re:"Useless syntax sugar": Numbered block parameters in Ruby by drewbug01 on Thursday October 12, 2023 @02:54PM (#37861413)
Huh - truly did not know about _negative_ arity in Ruby, and what that actually means. I learned something today, thank you!