Y
Hacker News
new
|
ask
|
show
|
jobs
by
winstonsmith
1430 days ago
My frustration is that you can't pass foo as an argument to another function.
2 comments
tomstuart
1430 days ago
Right, I see, because you have to say `method(:foo)` or `-> { foo }` or whatever. To me this is an acceptable syntactic trade-off in exchange for being able to invoke the method with bare `foo` (i.e. variable reads and method calls look the same) but I can see from other comments here that some people dislike that ability anyway. Vive la différence!
link
chrisseaton
1430 days ago
But you can. Method objects, proc objects, lambda objects, blocks, you've got a wealth of options here in Ruby.
link