Higher-order functions: Difference between revisions
VBA
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
(VBA) |
||
Line 2,752:
<lang v>2 3 [first] second</lang>
=6
=={{header|VBA}}==
Based on the Pascal solution
<lang pascal>Sub HigherOrder()
Dim result As Single
result = first("second")
MsgBox result
End Sub
Function first(f As String) As Single
first = Application.Run(f, 1) + 2
End Function
Function second(x As Single) As Single
second = x / 2
End Function</lang>
=={{header|Visual Prolog}}==
|