5 ms·
My frustration is that you can't pass foo as an argument to another function.
by winstonsmith 4y ago
My frustration is that you can't pass foo as an argument to another function.
- tomstuart 4y agoRight, 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!
- chrisseaton 4y agoBut you can. Method objects, proc objects, lambda objects, blocks, you've got a wealth of options here in Ruby.