Returns the filename extension.
+=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 sort (list)
For example:
#----------------------------------------------------------------------
# Text functions.
+# Join two lists.
+pure function join (xs, ys) returning strings = @{
+ for f in %xs %ys; do echo "$f"; done
+}
+
# Sort + uniq a list.
pure function sort (xs) returning strings = @{
for f in %xs; do echo "$f"; done | sort -u
--- /dev/null
+x1
+x2
+y1
+y2
+y 3
--- /dev/null
+# Goals test.
+# Copyright (C) 2020 Richard W.M. Jones
+# Copyright (C) 2020 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Join two lists.
+
+let xs = [ "x1", "x2" ]
+let ys = [ "y1", "y2", "y 3" ]
+let r = join (xs, ys)
+
+goal all = { for x in %r; do echo "$x"; done }
--- /dev/null
+#!/usr/bin/env bash
+# Goals test.
+# Copyright (C) 2020 Richard W.M. Jones
+# Copyright (C) 2020 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+goals -f 10-function-join.gl > 10-function-join.out
+diff -u 10-function-join.out 10-function-join.expected
+rm 10-function-join.out