[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Parameters in traditional programming languages
are evaluated before the call:
If the variable a
has the value 10, then
print a |
10
.
Shells (and Tcl) put implicit quotes around the arguments,,
and you have to use an evaluate operator to undo the quoting.
For example the operand xx$(a)yy
is implicitly translated
into (string_concat "xx" a "yy")
.
Implicit quoting is convenient when most arguments are constants, as in interactive use. Consider the alternative:
mv "-i" "foo.c" "foo.c.old" |
One the other, implicit quoting is clumsy when there are other data types in addition to strings. For example in:
abs -10 |
Q's solution is to provide macros, similar to those in Lisp: A macro is a function that is run at compile time to transform an expression into a different expression. Q provides primitives that makes it convenient to write macros in user-oriented terms. These are discussed next.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |