D
Dan Doel
Hi,
I was reading the comp.lang.functional group, and happened across a
little discussion of Ruby vs. Python on there.
One thing the Python guy asked was whether you could pass a function in
Ruby so that you could call it like:
f(args)
Which looks more like a real function call. And I must admit, that at
first, I was kind of put off at not being able
to pass functions around in Ruby and call them like normal functions
(I've since gotten used to the alternatives).
It got me thinking, why isn't it possible to overload a () operator for
this purpose? Was it a design decision of
the language or does it just add too much of a hassle for the parser? Or
was it something else?
Not that I'm complaining or anything, since I don't mind the way Ruby
does it. I'm just curious what the reasoning
was.
Thanks in advance.
- Dan
I was reading the comp.lang.functional group, and happened across a
little discussion of Ruby vs. Python on there.
One thing the Python guy asked was whether you could pass a function in
Ruby so that you could call it like:
f(args)
Which looks more like a real function call. And I must admit, that at
first, I was kind of put off at not being able
to pass functions around in Ruby and call them like normal functions
(I've since gotten used to the alternatives).
It got me thinking, why isn't it possible to overload a () operator for
this purpose? Was it a design decision of
the language or does it just add too much of a hassle for the parser? Or
was it something else?
Not that I'm complaining or anything, since I don't mind the way Ruby
does it. I'm just curious what the reasoning
was.
Thanks in advance.
- Dan