Function definition: Difference between revisions

Content added Content deleted
(Pari/GP)
m (→‎{{header|Tcl}}: whitespace)
Line 898: Line 898:
return [expr {$arg1 * $arg2}]
return [expr {$arg1 * $arg2}]
}</lang>
}</lang>
{{works with|Tcl|8.5}} <br>
{{works with|Tcl|8.5}}
You can also create functions that work directly inside expressions. This is done by creating the command with the correct name (that is, in the ''tcl::mathfunc'' namespace):
You can also create functions that work directly inside expressions. This is done by creating the command with the correct name (that is, in the ''tcl::mathfunc'' namespace):
<lang tcl>proc tcl::mathfunc::multiply {arg1 arg2} {
<lang tcl>proc tcl::mathfunc::multiply {arg1 arg2} {