

 This page uses content from Wikipedia. The original article was at Currying. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance)



Task

Create a simple demonstrative example of Currying in a specific language.

Add any historic details as to how the feature made its way into the language.




' FB 1.05.0 Win64
 
Type CurriedAdd
  As Integer i 
  Declare Function add(As Integer) As Integer
End Type
 
Function CurriedAdd.add(j As Integer) As Integer
  Return i + j
End Function
 
Function add (i As Integer) as CurriedAdd
   Return Type<CurriedAdd>(i)
End Function
 
Print "3 + 4 ="; add(3).add(4)
Print "2 + 6 ="; add(2).add(6)
Sleep