3 ms·
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 l
by inopinatus 3y ago
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.
- drewbug01 3y agoHuh - truly did not know about _negative_ arity in Ruby, and what that actually means. I learned something today, thank you!