"Ralph Mason" <ralph.mason / telogis.com> wrote in message
news:135701c1792a$679ffc90$0101a8c0 / p3...
> irb(main):010:0> def sq(x)
> irb(main):011:1> x+x
> irb(main):012:1> end
> nil
> irb(main):013:0> def aMes(f)
> irb(main):014:1> send(f,42) + send(f,27)
> irb(main):015:1> end
> nil
> irb(main):016:0> aMes :sq
> 138
> irb(main):017:0>
>

That is nice. It has the same level of compactness that I asked for.
The :sq handles the problem of delayed evalution.
I'd still like to be able to simply apply the parameters:
  f(42)
but it isn't too bad.
What remains then is partial evaluation:

def sum(a, b)
  a + b
end

plus4 = send(:sum, 4)
send(plus4, 8)
==> 12

Currently you get an argument count exception instead of a new function with
fewer arguments. A nice to have...


MikkelFJ