When set lists is enabled, values may be list of strings, as opposed to strings.
This enables a number of nice features, for example, with set list, quote() applies to each individual argument:
foo *args:
echo {{ quote(args) }}
So foo a 'b c' will print 'a' 'b c', instead of 'a b c'.
set lists is unstable, both because it's a huge change, and because there are many contexts, mainly the built-in functions, where the ideal behavior of lists is still undecided. Currently, join_list() must be used wherever lists are used in contexts expecting a string.
open questions
- Should we provide
TRUE and FALSE constants?
- Is
show() the right name for the list formatting function?
- Should exporting
[] set the environment variable to "" or skip setting it?
- Should
a + b where a or b is [] be identity?
todo
done
When
set listsis enabled, values may be list of strings, as opposed to strings.This enables a number of nice features, for example, with
set list,quote()applies to each individual argument:So
foo a 'b c'will print'a' 'b c', instead of'a b c'.set listsis unstable, both because it's a huge change, and because there are many contexts, mainly the built-in functions, where the ideal behavior of lists is still undecided. Currently,join_list()must be used wherever lists are used in contexts expecting a string.open questions
TRUEandFALSEconstants?show()the right name for the list formatting function?[]set the environment variable to""or skip setting it?a + bwhereaorbis[]be identity?todo
forexpression or list comprehension that evaluates to lists*for cartesian productmatchexpressions #1990done
set lists#3372absolute_path()distribute over lists #3374append()andprepend()over lists #3375--evaluate#3382show()function #3383show()and--evaluatein list tests #3384if A and Borif A or B#2562ifusing&&/||#3336!#3389bool()function #3391flag[arg]attribute #3398[parallel]with mapped dependencies #3399!=and==#3402ifwithoutelseevalutes to[]when false #3401assert(condition)evaluates tocondition#3405.envfiles #3412=~and!~#3414+and/work with lists #3415env()work with lists #3416split()function #3420which()requireset lists#3418++list concatenation operator #3427