aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-17 14:17:52 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-17 14:17:52 +0200
commitb13ee9da2aff4fa104185e0050697204d4fa6742 (patch)
treef4406fbc12734934c143467e769afaa630b519a5 /doc_src
parentf86ee20579180a9b8822c42fef8df3fca8ed12c0 (diff)
docs: Rename cross to cartesian product, clarify
Diffstat (limited to 'doc_src')
-rw-r--r--doc_src/tutorial.hdr11
1 files changed, 9 insertions, 2 deletions
diff --git a/doc_src/tutorial.hdr b/doc_src/tutorial.hdr
index 829e13e9..6ecd13c6 100644
--- a/doc_src/tutorial.hdr
+++ b/doc_src/tutorial.hdr
@@ -348,14 +348,21 @@ You can iterate over a list (or a slice) with a for loop:
<outp>entry: /usr/local/bin</outp>
\endfish
-If you append a list to a string (or to a list), it will build the cross-product:
+Lists adjacent to other lists or strings are expanded as cartesian products unless quoted (see <a href="index.html#expand-variable">Variable expansion</a>):
+
\fish{cli-dark}
>_ set -l a 1 2 3
>_ set -l 1 a b c
>_ echo $a$1
-<outp>1a 2a 3a 1b 2b 3b 1c 2c 3c
+<outp>1a 2a 3a 1b 2b 3b 1c 2c 3c</outp>
+>_ echo $a" banana"
+<outp>1 banana 2 banana 3 banana</outp>
+>_ echo "$a banana"
+<outp>1 2 3 banana</outp>
\endfish
+This is similar to <a href="index.html#expand-brace">Brace expansion</a>.
+
\section tut_command_substitutions Command Substitutions
Command substitutions use the output of one command as an argument to another. Unlike other shells, `fish` does not use backticks ` for command substitutions. Instead, it uses parentheses: