From b13ee9da2aff4fa104185e0050697204d4fa6742 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 17 Sep 2015 14:17:52 +0200 Subject: docs: Rename cross to cartesian product, clarify --- doc_src/tutorial.hdr | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'doc_src') 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: entry: /usr/local/bin \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 Variable expansion): + \fish{cli-dark} >_ set -l a 1 2 3 >_ set -l 1 a b c >_ echo $a$1 -1a 2a 3a 1b 2b 3b 1c 2c 3c +1a 2a 3a 1b 2b 3b 1c 2c 3c +>_ echo $a" banana" +1 banana 2 banana 3 banana +>_ echo "$a banana" +1 2 3 banana \endfish +This is similar to Brace expansion. + \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: -- cgit v1.2.3