From 333e7443bbcb0dc07b113d70b9d52cdabfef5ae9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 12 Jan 2020 19:34:39 +0000 Subject: [PATCH] docs: Document functions sort, wildcard and wrap. --- docs/Goalfile.pod | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/Goalfile.pod b/docs/Goalfile.pod index d58993e..9731cb1 100644 --- a/docs/Goalfile.pod +++ b/docs/Goalfile.pod @@ -14,6 +14,14 @@ Goalfile - introduction, tutorial, and reference for writing goal files =head2 Standard Functions +=head3 sort (list) + +For example: + + sort (["c", "b", "b", "a"]) ⇒ ["a", "b", "c"] + +This takes a list of strings and sorts it, removing duplicates. + =head3 subst (from, to, text) For example: @@ -25,6 +33,26 @@ This function works something like make’s C function, except that C is a regular expression, specifically a L extended regular expression. +=head3 wildcard (pattern) + +For example: + + wildcard ("*.c") ⇒ ["bar.c", "foo.c"] + +The single parameter is a wildcard which is expanded into a list of +files using ordinary globbing rules. + +=head3 wrap (wrapper, list) + +For example: + + wrap ("*file", ["bar.c", "foo.c"]) ⇒ [*file("bar.c"), *file("foo.c")] + +Each element in C is wrapped into a call to C. +There are two common uses for this: either to add explicit tactics +(such as C<*file>) to a plain list of strings as in the example above; +or to turn a list of strings into a list of goal or function calls. + =head1 SEE ALSO L. -- 1.8.3.1