Project

General

Profile

Feature #11161

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

currenty with curry you can only replace elements in order 
 `#rcurry` #rcurry should be added to be able to return the last parameter first. 


 ```ruby ` 
 def abc(a,b); "a=#{a}, b=#{b}"; end 
 c= method(:abc).curry 

 c[1,2] #=> "a=1, b=2"  
 c[1][2] #=> "a=1, b=2"  
 ``` ` 

 i image rcurry to be like that: 
 ```ruby ` 
 def abc(a,b); "a=#{a}, b=#{b}"; end 
 c= method(:abc).rcurry(2) 

 c[1,2] #=> "a=2, b=1"  
 c[1][2] #=> "a=2, b=1"  
 ``` ` 

 because of optional parameters, rcurry might be only be used when giving the arity

Back