aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-util.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r--src/interp/g-util.boot9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index e0c587e7..178ec1ab 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -497,6 +497,9 @@ insertWOC(x,y) ==
fn(x,t)
+++ Post-compose substitution `subst' with `s +-> v'
+postComposeSubst(subst,s,v) ==
+ [[x,:substitute(v,s,y)] for [x,:y] in subst]
--% Miscellaneous Functions for Working with Strings
@@ -960,6 +963,12 @@ gensymInt g ==
n := 10 * n + charDigitVal stringChar(p,i)
n
+++ Return true if var is a query variable, e.g. any identifier
+++ that starts with a question mark.
+queryVar? var ==
+ s := symbolName var
+ #s > 1 and stringChar(s,0) = char "?" and digit? stringChar(s,1)
+
++ Returns a newly allocated domain shell (a simple vector) of length `n'.
newShell: %Short -> SIMPLE_-ARRAY
newShell n ==