Call a function: Difference between revisions

Content added Content deleted
Line 817: Line 817:
However, there are no deep differences between the two: functions are translated into commands that are called in a particular namespace (thus <tt>foo()</tt> becomes <tt>tcl::mathfunc::foo</tt>).
However, there are no deep differences between the two: functions are translated into commands that are called in a particular namespace (thus <tt>foo()</tt> becomes <tt>tcl::mathfunc::foo</tt>).
There are no differences in usage between built-in commands and user-defined ones, and parameters are passed to commands by value conceptually (and read-only reference in the implementation).
There are no differences in usage between built-in commands and user-defined ones, and parameters are passed to commands by value conceptually (and read-only reference in the implementation).

=={{header|UNIX Shell}}==

In the shell, there are no argument specifications for functions. Functions obtain their arguments using the positional parameter facilities and functions are simply called by name followed by any arguments that are to be passed:

<lang sh> sayhello # Call a function with no arguments
multiply 3 4 # Call a function with two arguments</lang>

The shell does not support the use of named parameters.


=={{header|ZX Spectrum Basic}}==
=={{header|ZX Spectrum Basic}}==