forked from hraberg/Shen.java
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patherrors_debug.shen
More file actions
43 lines (36 loc) · 1.27 KB
/
errors_debug.shen
File metadata and controls
43 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
\*
See following two posts :
https://groups.google.com/d/msg/qilang/3DXJWo0hcRc/wNUU5OKdDMkJ
https://groups.google.com/d/msg/qilang/9WxbCbxg8f4/dJsJtLmREkcJ
Note that you can only track functions which are not made
external. For example if you add "bind" to the list below,
Shen complains that it is not a legitimate function name
*\
(package shen []
\\from prolog.shen
(define deref
[X | Y] ProcessN -> [(deref X ProcessN) | (deref Y ProcessN)]
X ProcessN -> (if (pvar? X)
(let Value (valvector X ProcessN)
(if (= Value -null-)
X
(deref Value ProcessN)))
X))
\\from prolog.shen
(define lazyderef
X ProcessN -> (if (pvar? X)
(let Value (valvector X ProcessN)
(if (= Value -null-)
X
(lazyderef Value ProcessN)))
X))
\*
\\from prolog.shen
(define bind
X Y ProcessN Continuation -> (do (bindv X Y ProcessN)
(let Result (thaw Continuation)
(do (unbindv X ProcessN)
Result))))
*\
)
(map (function track) [shen.deref shen.lazyderef])