Function definition: Difference between revisions

→‎{{header|TXR}}: Corrections.
(→‎{{header|TXR}}: Corrections.)
Line 1,613:
@(end)
@(multiply 3 4 result)</lang>
<pre>$ txr -B multiply.txr
result="12"</pre>
In the embedded Lisp dialect, it is possible to write an ordinary function that returns a value:
<lang txr>@(do (defun mult (a b) (* a b))
(formatput-line t "`3 * 4 = ~a\n" @(*mult 3 4)`))</lang>
<pre>$ txr -B multiply2.txr
3 * 4 = 12</pre>
 
543

edits