diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-13 13:13:29 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-14 15:29:17 +0200 |
commit | 7482b4b90b376cc1d1d64ef827d9014879f0ef84 (patch) | |
tree | e379fee1064b9dc52b812c4f6b578b1012ebfd77 /doc/concepts | |
parent | 21359a210cecf01d0c0e3ff47873692bdb1390a9 (diff) | |
download | justbuild-7482b4b90b376cc1d1d64ef827d9014879f0ef84.tar.gz |
expression language: add nub_left
Originally, the expression lanuage only contained a function to
deduplicate a list, keeping only the right-most occurence. The
reason was that this is the order needed for linking: a library
providing an open symbol has to come on the command line after the
library using that symbol (and hence making it an open symbol).
However, by now use cases have emerged that require a topological
sorting where definition comes before use; also, when composing
the value of PATH from fragments, we usually want to keep the first
occurrence in order for it to take precedence. Therefore, also
add "nub_left" as built-in function, allowing a more condense (and
slightly more efficient) description in rules instead of the
revserse-nub_right-reverse pattern.
Diffstat (limited to 'doc/concepts')
-rw-r--r-- | doc/concepts/expressions.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/concepts/expressions.md b/doc/concepts/expressions.md index c75f00dc..4db7c8cb 100644 --- a/doc/concepts/expressions.md +++ b/doc/concepts/expressions.md @@ -248,6 +248,11 @@ those) argument(s) to obtain the final result. result is the input list, except that for all duplicate values, all but the rightmost occurrence is removed. + - `"nub_list"` The argument has to be a list. It is an error + if that list contains (directly or indirectly) a name. The + result is the input list, except that for all duplicate + values, all but the leftmost occurrence is removed. + - `"basename"` The argument has to be a string. This string is interpreted as a path, and the file name thereof is returned. |