Function definition: Difference between revisions

no edit summary
(adding gap)
No edit summary
Line 1,528:
Call the function
<lang vbnet>Multiply(1, 1)</lang>
 
=={{header|Wart}}==
A straightforward way to say how calls of the form <code>(multiply a b)</code> are translated:
<lang python>def (multiply a b)
a*b</lang>
 
<pre>(multiply 3 4)
=> 12</pre>
 
Functions can also use keyword args.
 
<pre>(multiply 3 :a 4) # arg order doesn't matter here, but try subtract instead
=> 12</pre>
 
Finally, we can give params better keyword args using <em>aliases</em>:
 
<lang python>def (multiply a b|by)
(* a b)</lang>
 
<pre>multiply 3 :by 4
=> 12</pre>
 
=={{header|X86 Assembly}}==
143

edits