bootstrap
view genesis/church/prolog/prolog-support.church @ 616:723871f2f056
comment out more debug statements
fix up interpreter-test
fix up interpreter-test
| author | John Leuner <jewel@subvert-the-dominant-paradigm.net> |
|---|---|
| date | Sun Nov 22 12:55:44 2009 +0200 (2009-11-22) |
| parents | |
| children |
line source
1 ; these routines should be in base.church
3 push-new x n:nil
4 list x
6 push-new x l:cons
7 if (member? x l)
8 l
9 else
10 cons x l
12 mapcan fn n:nil
13 nil
15 mapcan fn l:cons
16 collector = nil
17 loop
18 for el in l
19 do
20 collector = append! collector (apply fn el)
22 collector
24 mapcar fn n:nil
25 nil
27 mapcar fn l:cons
28 collector = nil
29 loop
30 for el in l
31 do
32 collector = cons (apply fn el) collector
34 reverse! collector
36 sublis env x
37 lookup = (fn a
38 v = assoc a env
39 if v
40 rest v
41 else
42 a
43 )
44 cond
45 (null? x) nil
46 (not (cons? x)) (lookup x)
47 true (cons (sublis env (car x)) (sublis env (cdr x)))
