>>>>> "Y" == Yusuke ENDOH <mame / tsg.ne.jp> writes:

Y> Are you saying about [ruby-core:15716] ?

 yes,


Y> Hmm, I think it's a kind of nonessential hack, so I don't
Y> want to insert it into Proc#curry preferably.

 a call to rb_mod_method_arity() (well a modified version :-)) is a hack  ?

Y> If it is a feature that :+.to_proc.arity is -1, we should
Y> specify the number of arguments of such a proc as well as
Y> another normal proc that receives optional arugments, I
Y> think.

 How do you do this ?

vgs% cat cur.rb
class A
   define_method(:a) do |x, y|
      puts "a #{x} -- #{y}"
   end
end

class B
   def a(x)
      puts "b #{x}"
   end
end

a = :a.to_proc.curry
b = a[A.new]
c = b[12]
c[12]

b = a[B.new]
b[12]

vgs% 


vgs% ./ruby cur.rb
a 12 -- 12
b 12
vgs% 


Guy Decoux