Last active
April 12, 2019 00:16
-
-
Save reinh/bfcfb7ca6fe6b010599d1b7dd291137e to your computer and use it in GitHub Desktop.
This file contains 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
class Proc | |
%i[! ~].each do |op| | |
define_method(op) { ->(x) { call(x).send(op)} } | |
end | |
%i[+ - * / ^ & |].each do |op| | |
define_method(op) { |other| ->(x) { call(x).send op, other.call(x) } } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment