Call a function: Difference between revisions

Line 3,700:
<syntaxhighlight lang="langur">
val fibonacci = fn x:if x < 2 { x } else { fn((x - 1)) + fn((x - 2)) }
</syntaxhighlight>
 
=== argument expansion ===
Use the expansion operator (...) to pass a list as multiple arguments. The following example works if wordsets is a list of lists, and passes each each list as a separate argument to the mapX function.
 
<syntaxhighlight lang="langur">
mapX(amb, wordsets...)
</syntaxhighlight>
 
1,007

edits