Created
November 3, 2010 23:41
-
-
Save rezonant/661904 to your computer and use it in GitHub Desktop.
Making a clean, modular, disposable binding for a shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module SomeCommands; def add(x, y) x + y end; end; import SomeCommands; | |
| add 1, 1 # => 2 | |
| String.add 1, 1 # => 2 # ... with some solutions | |
| "hello".add 1, 1 # => # ... with others | |
| "hello".add 1, 1 # NoMethodError # is what I want | |
| "hello".instance_eval "add(1, 1)" # NoMethodError # as well |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment