diff options
author | Brad King <brad.king@kitware.com> | 2021-12-22 13:52:41 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-12-22 13:53:02 (GMT) |
commit | 69eb5b24219c4e50ba520a46264443c3091803af (patch) | |
tree | 70917da7c20a6ddaf782eff51f9bbc96c12680f8 /Help | |
parent | 217f363cac32c59ee05ccc4856396a099150475b (diff) | |
parent | b573a732dc654f82bd70aeb53666fcf61f26ca16 (diff) | |
download | CMake-69eb5b24219c4e50ba520a46264443c3091803af.zip CMake-69eb5b24219c4e50ba520a46264443c3091803af.tar.gz CMake-69eb5b24219c4e50ba520a46264443c3091803af.tar.bz2 |
Merge topic 'doc-list-non-existent'
b573a732dc Tests: add tests to check claims in the documentation
b151db01f9 Help: mention non-existent case for list(PREPEND)
b3a249c2cb Help: clarify range for list(INSERT), mention nonexistent / empty case
b6fdcb3df0 Help: clarify description of list(INSERT)
e55f473ea9 Help: clarify that list(APPEND) on a non-existent list creates it
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6824
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/list.rst | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Help/command/list.rst b/Help/command/list.rst index 9b49cb4..33c4f80 100644 --- a/Help/command/list.rst +++ b/Help/command/list.rst @@ -128,7 +128,9 @@ Modification list(APPEND <list> [<element> ...]) -Appends elements to the list. +Appends elements to the list. If no variable named ``<list>`` exists in the +current scope its value is treated as empty and the elements are appended to +that empty list. .. _FILTER: @@ -150,7 +152,12 @@ For more information on regular expressions look under list(INSERT <list> <element_index> <element> [<element> ...]) -Inserts elements to the list to the specified location. +Inserts elements to the list to the specified index. It is an +error to specify an out-of-range index. Valid indexes are 0 to `N` +where `N` is the length of the list, inclusive. An empty list +has length 0. If no variable named ``<list>`` exists in the +current scope its value is treated as empty and the elements are +inserted in that empty list. .. _POP_BACK: @@ -186,7 +193,9 @@ to the given variables and then remove the first `N` values from .. versionadded:: 3.15 -Insert elements to the 0th position in the list. +Insert elements to the 0th position in the list. If no variable named +``<list>`` exists in the current scope its value is treated as empty and +the elements are prepended to that empty list. .. _REMOVE_ITEM: |