X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=docs%2FGoalfile.pod;h=9731cb1c8c3393de0f370409fcc6963e3bb9713d;hb=333e7443bbcb0dc07b113d70b9d52cdabfef5ae9;hp=da4b1428ba50093bc6691edc885054905f79105b;hpb=70c689283bb2c1ba07704be7562767daf82b4d46;p=goals.git diff --git a/docs/Goalfile.pod b/docs/Goalfile.pod index da4b142..9731cb1 100644 --- a/docs/Goalfile.pod +++ b/docs/Goalfile.pod @@ -12,6 +12,47 @@ Goalfile - introduction, tutorial, and reference for writing goal files =head1 REFERENCE +=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: + + subst ("aa", "AA", "aabbccaa") ⇒ "AAbbccAA" + subst ("a.*c", "b", "aaacac") ⇒ "bb" + +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.