1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Eval_clearall = ->
|
18 | do_clearall()
|
19 | push(symbol(NIL))
|
20 |
|
21 | do_clearall = ->
|
22 | if (test_flag == 0)
|
23 | clear_term()
|
24 |
|
25 | do_clearPatterns()
|
26 | clear_symbols()
|
27 | defn()
|
28 | codeGen = false
|
29 |
|
30 |
|
31 | clearall = ->
|
32 | run("clearall")
|
33 |
|
34 |
|
35 |
|
36 | clearRenamedVariablesToAvoidBindingToExternalScope = ->
|
37 | for i in [0...symtab.length]
|
38 | if symtab[i].printname.indexOf("AVOID_BINDING_TO_EXTERNAL_SCOPE_VALUE") != -1
|
39 |
|
40 | symtab[i].k = SYM
|
41 | symtab[i].printname = ""
|
42 | binding[i] = symtab[i]
|
43 | isSymbolReclaimable[i] = true
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | Eval_clear = ->
|
64 | p2 = cdr(p1)
|
65 |
|
66 | while (iscons(p2))
|
67 | variableToBeCleared = car(p2)
|
68 |
|
69 |
|
70 |
|
71 | if (variableToBeCleared.k != SYM)
|
72 | stop("symbol error")
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | indexFound = symtab.indexOf(variableToBeCleared)
|
79 | symtab[indexFound].k = SYM
|
80 | symtab[indexFound].printname = ""
|
81 | binding[indexFound] = symtab[indexFound]
|
82 | isSymbolReclaimable[indexFound] = true
|
83 |
|
84 |
|
85 | p2 = cdr(p2)
|
86 |
|
87 | push(symbol(NIL))
|