stdlib: Implement read() and readlines() functions.
[goals.git] / docs / Goalfile.pod
index 40ca73a..46fbe1d 100644 (file)
@@ -38,6 +38,14 @@ For example:
 
 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:
@@ -48,6 +56,23 @@ 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 read (filename)
+
+For example:
+
+ read ("filename") => "this is the content of filename"
+
+Read the contents of C<filename> and return it as a single string.
+If there is a trailing C<\n> in the file it is truncated.
+
+=head3 readlines (filename)
+
+For example:
+
+ readlines ("filename") => ["line1", "line2", "line3"]
+
+Read the lines in C<filename> returning a list of strings.
+
 =head3 realpath (filename)
 
 For example:
@@ -76,6 +101,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: