From 4c9d10065c104b0d34632976646ce9e9d589b6d9 Mon Sep 17 00:00:00 2001 From: Wesley Aptekar-Cassels Date: Sun, 5 Nov 2017 13:53:35 -0500 Subject: [PATCH] Add another sequential list example to stage_1 This example clarifies the order of operations in more detail than the rest of the examples in this section. --- stage_1.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stage_1.md b/stage_1.md index ffb45c4..288bb96 100644 --- a/stage_1.md +++ b/stage_1.md @@ -158,6 +158,16 @@ false && echo foo || echo bar true || echo foo && echo bar ``` +This should echo "foobar": +``` +true && printf foo || false && printf bar +``` + +This is equivalent to: +``` +(((true && printf foo) || false) && printf bar) +``` + The standard calls these *sequential lists*, *AND lists*, and *OR lists*, respectively. See section 2.9.3, [Lists]. We'll look at *asynchronous lists* in stage 3.