diff options
Diffstat (limited to 'web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-proc-ext/mrblib')
-rw-r--r-- | web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb deleted file mode 100644 index b71663938..000000000 --- a/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +++ /dev/null @@ -1,42 +0,0 @@ -class Proc - - def ===(*args) - call(*args) - end - - def yield(*args) - call(*args) - end - - def to_proc - self - end - - def curry(arity=self.arity) - type = :proc - abs = lambda {|a| a < 0 ? -a - 1 : a} - arity = abs[arity] - if lambda? - type = :lambda - self_arity = self.arity - if (self_arity >= 0 && arity != self_arity) || - (self_arity < 0 && abs[self_arity] > arity) - raise ArgumentError, "wrong number of arguments (#{arity} for #{abs[self_arity]})" - end - end - - pproc = self - make_curry = proc do |given_args=[]| - send(type) do |*args| - new_args = given_args + args - if new_args.size >= arity - pproc[*new_args] - else - make_curry[new_args] - end - end - end - make_curry.call - end - -end |