Function definition: Difference between revisions

→‎{{header|PARI/GP}}: second syntax and clarification
m (changed lang to geshi name)
(→‎{{header|PARI/GP}}: second syntax and clarification)
Line 677:
=={{header|PARI/GP}}==
<lang parigp>multiply(a,b)=a*b;</lang>
or
<lang parigp>multiply=(a,b)->a*b;</lang>
 
Note that in both cases the <code>;</code> is part of the definition of the function, not of the function itself: it suppresses the output of the function body, but does not suppress the output of the function when called. To do that, either double the semicolon (which will suppress the output of both) or wrap in braces:
<lang parigp>multiply={(a,b)->a*b;}</lang>
which will output the function but define a function which calculates but does not return the product.
 
=={{header|Pascal}}==