Call a function: Difference between revisions

Content added Content deleted
No edit summary
(added langur language example)
Line 2,389: Line 2,389:
Hello world
Hello world
</pre>
</pre>

=={{header|langur}}==
User-defined and built-in functions can be called using parentheses.

Built-in functions can also be called using an "unbounded list," which ends at a line return, EOF, closing parenthesis, curly brace, or square bracket, or before a comma preceding a line return.

=== parentheses ===
<lang langur>.x()
# call user-defined function</lang>

<lang langur>write(.key, ": ", .value)
# call built-in with parentheses</lang>

=== unbounded lists ===
<lang langur>write .key, ": ", .value
# call built-in with unbounded list</lang>

<lang langur>write .key, ": ", .value
# call built-in with unbounded list</lang>

<lang langur>val .sum = foldfrom(
f(.sum, .i, .c) .sum + toNumber(.c, 36) x .weight[.i],
0,
pseries len .code,
split ZLS, .code,
)
# split and pseries both using unbounded lists, ending before comma preceding line return
</lang>


=={{header|LFE}}==
=={{header|LFE}}==