-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define method by braces #5
base: master
Are you sure you want to change the base?
Conversation
Check out https://gist.github.com/chancancode/0087d86c935db02453ae, I think you can use some of the same tricks here so you can pass real ruby code in the block instead of string. The drawback is you'd need |
Wow, awesome. I'm gonna do same things. thanks. |
hahaha, there are many quirks :P Just updated the gist and fixed the follow case.. previously it couldn't tell between these two: function x() { ... }
function(x) { ... } Turns out you can infer it based on whether the block is attached to This would probably come in handy for you cause all of your method definitions will look like |
@chancancode Hmm, it does make sense. nice idea. I'm gonna do that. |
I just try to extract the code from a block by using seattlerb/ruby2rbuy and eval. but ... I couldn't do from block made dynamic. You'er way is most reasonable after all. |
I don't know about "reasonable", but it was certainly fun :P — On Thu, Dec 4, 2014 at 4:20 PM, Kazuki Tanaka [email protected]
|
I'm aiming to https://gist.github.com/chancancode/61f31ac0b508c8eccad7
Right now, we can write as below.