Call a function: Difference between revisions
m
→unbounded lists
m (→{{header|Wren}}: Changed to Wren S/H) |
Langurmonkey (talk | contribs) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 840:
<b>Subroutines</b> are provided for compatibility with older, unstructured dialects of BASIC; otherwise they are never really used. They require statements to be numbered, and they can neither receive arguments nor return values: they can only manipulate global variables. The <tt>GOSUB</tt> and <tt>RETURN</tt> statements in fact mirror assembly language 'jump to subroutine' and 'return from subroutine' instructions quite closely.
<syntaxhighlight lang="bbcbasic">200 GOSUB 30050</syntaxhighlight>
=={{header|Binary Lambda Calculus}}==
Function calling is the sole primitive in the Lambda Calculus. The application of function f on argument a is denoted 01 f a in Binary Lambda Calculus. Multi argument functions are achieved by currying, i.e. a function of the first argument returns a function of the 2nd argument, etc. A good example is the Church numeral 2, which given a function f and an argument x, applies f twice on x: C2 = \f. \x. f (f x). This is written in BLC as
<pre>00 00 01 110 01 110 01</pre>
=={{header|BQN}}==
Line 3,685 ⟶ 3,692:
<syntaxhighlight lang="langur">val .sum = foldfrom(
0,
pseries len .code,
split
)
# split, pseries, and len using unbounded lists, ending before comma preceding line return</syntaxhighlight>
Line 3,696 ⟶ 3,703:
}
# unbounded list on keys bounded by closing parenthesis of sort</syntaxhighlight>
=={{header|Latitude}}==
|