RosettaCodeData/Task/Call-a-foreign-language-function/Arturo/call-a-foreign-language-function-2.arturo

15 lines
328 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
; call an external function directly
call.external: "mylib" 'sayHello ["John"]
; map an external function to a native one
doubleNum: function [num][
ensure -> integer? num
call .external: "mylib"
.expect: :integer
'doubleNum @[num]
]
loop 1..3 'x [
print ["The double of" x "is" doubleNum x]
]