Created
November 27, 2008 02:27
-
-
Save nkpart/29666 to your computer and use it in GitHub Desktop.
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
| require 'prohax' | |
| def add a | |
| let( :to => proc { |b| b + a }) | |
| end | |
| add(5).to(3) | |
| # => 8 | |
| def _if s | |
| let( :then => proc { |blk| blk.call if s }) | |
| end | |
| _if(true).then proc { 5 } | |
| # => 5 | |
| _if(false).then proc { 5 } | |
| # => nil | |
| # I have no idea why you would do it that way. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment