git.annexia.org
/
goals.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca19d10
)
stdlib: Add wrap function.
author
Richard W.M. Jones
<rjones@redhat.com>
Fri, 10 Jan 2020 12:15:41 +0000
(12:15 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Fri, 10 Jan 2020 12:16:07 +0000
(12:16 +0000)
stdlib/prelude.gl
patch
|
blob
|
history
diff --git
a/stdlib/prelude.gl
b/stdlib/prelude.gl
index
f4ab20e
..
a73ef1a
100644
(file)
--- a/
stdlib/prelude.gl
+++ b/
stdlib/prelude.gl
@@
-38,6
+38,20
@@
tactic *exists (filename) = @{
}
#----------------------------------------------------------------------
+# Basic functions.
+
+# Wrap list of strings in a call or tactic.
+pure function wrap (wrapper, xs) = @{
+ echo '['
+ for x in %xs; do
+ echo %wrapper "( "
+ quoted_string "$x"
+ echo " ),"
+ done
+ echo ']'
+}
+
+#----------------------------------------------------------------------
# Text functions.
# Sort + uniq a list.