Return multiple values: Difference between revisions

Added EasyLang implementation
(add bqn)
(Added EasyLang implementation)
Line 887:
<pre>10
20</pre>
 
=={{header|EasyLang}}==
In EasyLang, functions return one value. To return a set of values, use an array.
<syntaxhighlight lang="easylang">
func addSubtract a b . result[] .
result[] &= a + b
result[] &= a - b
.
call addSubtract 7 5 result[]
print "Sum: " & result[1]
print "Difference: " & result[2]
</syntaxhighlight>
{{out}}
<pre>
Sum: 12
Difference: 2
</pre>
 
=={{header|EchoLisp}}==
175

edits