2 ms·
I should explain a little more. You never actually see the lambda method, the RewriteRails plugin works a little like Lisp's macros. You write: returning [
by raganwald 17y ago
I should explain a little more. You never actually see the lambda method, the RewriteRails plugin works a little like Lisp's macros. You write:
returning [1] do |numbers|
numbers << 2
numbers += [3]
end
And that's all you see in your source code. RewriteRails rewrites that into:
lambda do |numbers|
numbers << 2
numbers += [3]
numbers
end.call([1])
And that's what the ruby interpreter sees. But you need never look at the "ugly" rewritten version, just what you wrote.
- btakita 17y agoI can see that as an improvement. Thanks for the follow up.