stdlib: Implement head() and tail() functions.
[goals.git] / docs / Goalfile.pod
index 9731cb1..37f3c07 100644 (file)
@@ -14,6 +14,57 @@ Goalfile - introduction, tutorial, and reference for writing goal files
 
 =head2 Standard Functions
 
+=head3 basename (path)
+
+For example:
+
+ basename ("dir/file.ext") ⇒ "file.ext"
+
+Returns the filename part of the path.
+
+=head3 dirname (path)
+
+For example:
+
+ dirname ("dir/file.ext") ⇒ "dir"
+
+Returns the directory part of the path.
+
+=head3 extension (filename)
+
+For example:
+
+ extension ("dir/file.ext") ⇒ "ext"
+
+Returns the filename extension.
+
+=head3 head (list)
+
+For example:
+
+ head (["a", "b", "c"]) ⇒ "a"
+
+Returns the head (first) element of the list.
+
+=head3 join (list1, list2)
+
+For example:
+
+ join (["a", "b"], ["c", "d"]) ⇒ ["a", "b", "c", "d"]
+
+Concatenate C<list1> and C<list2>.  It's not usually necessary to use
+this function since goals automatically flattens lists within lists
+into simple lists in many cases.
+
+=head3 realpath (filename)
+
+For example:
+
+ realpath ("./tests") ⇒ "/home/user/tests"
+
+Run the L<realpath(1)> command to return the resolved absolute path of
+the C<filename> parameter.
+
 =head3 sort (list)
 
 For example:
@@ -33,6 +84,14 @@ This function works something like make’s C<subst> function, except
 that C<from> is a regular expression, specifically a L<sed(1)>
 extended regular expression.
 
+=head3 tail (list)
+
+For example:
+
+ tail (["a", "b", "c"]) ⇒ ["b", "c"]
+
+Returns the tail (all except first) elements of the list.
+
 =head3 wildcard (pattern)
 
 For example: