3 ms·
> Lamdas check the number of arguments, while procs do not FWIW, Matz himself called this difference "a design mistake".
by endorphine 1y ago
> Lamdas check the number of arguments, while procs do not
FWIW, Matz himself called this difference "a design mistake".
- weaksauce 1y agowhich way would he have liked to be the "correct way"
- drnewman 1y agoI'd think the preferred way would be to implement them as a separate class. That'd be more in line with the design of other core classes (like TrueClass & FalseClass). It'd also have created the opportunity to create a "Callable" protocol early in the design which would have been great, and would harmonize with the design of Ruby's many other protocols Enumerable, Comparable, Range-compatible values, etc.
- jez 1y agoDo you have a source for this?
- endorphine 1y agoHe mentioned it in-person to me.
- drnewman 1y agoYeah, I think I've heard that too.