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.boot8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 8c741420..4404d105 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -137,6 +137,14 @@ walkWith!(x,f) ==
ys.first := walkWith!(first ys,f)
apply(f,x,nil)
+prefixWalk!(x,f) ==
+ atomic? x => x
+ x := apply(f,x,nil)
+ atomic? x => x
+ for xs in tails x | not atomic? first xs repeat
+ xs.first := prefixWalk!(first xs,f)
+ x
+
listify x ==
x is [.,:.] => x
[x]