summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-proc-ext/mrblib/proc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-proc-ext/mrblib/proc.rb')
-rw-r--r--mrbgems/mruby-proc-ext/mrblib/proc.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/mrbgems/mruby-proc-ext/mrblib/proc.rb b/mrbgems/mruby-proc-ext/mrblib/proc.rb
index b71663938..abe9c7944 100644
--- a/mrbgems/mruby-proc-ext/mrblib/proc.rb
+++ b/mrbgems/mruby-proc-ext/mrblib/proc.rb
@@ -27,7 +27,7 @@ class Proc
pproc = self
make_curry = proc do |given_args=[]|
- send(type) do |*args|
+ __send__(type) do |*args|
new_args = given_args + args
if new_args.size >= arity
pproc[*new_args]
@@ -39,4 +39,12 @@ class Proc
make_curry.call
end
+ def <<(other)
+ ->(*args, &block) { call(other.call(*args, &block)) }
+ end
+
+ def >>(other)
+ ->(*args, &block) { other.call(call(*args, &block)) }
+ end
+
end