Call a function: Difference between revisions
Content added Content deleted
Line 2,061: | Line 2,061: | ||
--?myfunction(b:="though") -- compile-time error</lang> |
--?myfunction(b:="though") -- compile-time error</lang> |
||
* The programmer is free to use either positional parameters or named parameters, or a mixture of both (with positional parameters first). |
* The programmer is free to use either positional parameters or named parameters, or a mixture of both (with positional parameters first). |
||
* Phix does not support first-class functions, but instead uses an integer routine_id mechanism (and obviously integers are first-class): |
* Phix does not support first-class functions directly, but instead uses an integer routine_id mechanism (and obviously integers are first-class): |
||
<lang Phix>constant integer r_my_func = routine_id("myroutine") |
<lang Phix>constant integer r_my_func = routine_id("myroutine") |
||
?call_func(r_my_func,{1}) -- displays {1,"default"}</lang> |
?call_func(r_my_func,{1}) -- displays {1,"default"}</lang> |