Suppose I have def f(a); a + 1; end def f(a); a + 1; end def f(a); a + 1; end and apply f to the list, it usually looks like [1,2,3].map { |x| fx } [1,2,3].map { |x| fx } .
And when I want to use η-reduction ( (λx.Mx) → M ), I have an error here:
> [1,2,3].map f ArgumentError: wrong number of arguments (0 for 1) from (irb):2:in `f' from (irb):4 from /usr/bin/irb:12:in `<main>'
What needs to happen for it to become valid Ruby syntax?
source share