RosettaCodeData/Task/Currying/FreeBASIC/currying.basic
2023-07-01 13:44:08 -04:00

18 lines
338 B
Text

' 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