Function definition: Difference between revisions
Content deleted Content added
Euphoria version |
sequence comprehension demo |
||
Line 244:
return a * b
end function</lang>
If you declare the arguments as <code>object</code> then sequence comprehension kicks in:
<lang Euphoria>function multiply( object a, object b )
return a * b
end function
sequence a = {1,2,3,4}
sequence b = {5,6,7,8}
? multiply(a,b)</lang>
which outputs
<code>{5,12,21,32}</code>
=={{header|Erlang}}==
|