Hacker News new | past | comments | ask | show | jobs | submit login

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.



I can see that as an improvement. Thanks for the follow up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: