Function definition: Difference between revisions
→{{header|langur}}
LalaithMeren (talk | contribs) mNo edit summary |
Langurmonkey (talk | contribs) |
||
Line 2,208:
=== parameters ===
Parameters are defined within parentheses after the fn token. To specify no parameters, use an empty set of parentheses.
<syntaxhighlight lang="langur">val
=== operator implied functions ===
Operator implied functions are built using an infix operator between curly braces on an fn token.
<syntaxhighlight lang="langur">val
=== nil left partially implied functions ===
These are built with an infix operator and a right-hand operand inside the fn{
<syntaxhighlight lang="langur">val
map
=== impure functions (I/O) ===
Impure functions must be declared as such.
<syntaxhighlight>val
Impure functions cannot be passed to pure functions.
|