|
|
Two words or lists can be concatenated, or joined together, using the ``^'' (circumflex or caret) character.
Lists can only be concatenated if they both contain the same number of elements, or if one of them only contains one element or is empty, as illustrated by the following examples:
a | b | a^b |
---|---|---|
w | x | wx |
w | (x y z) | (wx wy wz) |
(w x y) | (a b c) | (wa xb yc) |
(w x y) | ( ) | (w x y) |
(w x y) | (a b) | illegal |
Several concatenations can be included in one expression, as in:
s.^(in proc out)^.main.^(c h s)which evaluates to:
(s.in.main.c s.proc.main.h s.out.main.s)
Deskshell allows circumflexes to be omitted when the context makes it unambiguous. For example, $file^.c can be written as $file.c instead.
See also: