commit 5e910afaf0c590a31c23db2f1fd0c2d37783d0b8
parent fc57b44da5927324edc908fd1d365b345cc787c1
Author: Alexander Burger <abu@software-lab.de>
Date: Wed, 14 Nov 2012 20:14:41 +0100
Backtrace with 'trail' and 'up' (64-bit)
Diffstat:
16 files changed, 567 insertions(+), 423 deletions(-)
diff --git a/CHANGES b/CHANGES
@@ -1,4 +1,5 @@
* DDmmm12 picoLisp-3.1.1
+ Backtrace with 'trail' and 'up' (64-bit)
Changed semantics of token 'read'
-server function
64-bit emulator
diff --git a/doc/ref.html b/doc/ref.html
@@ -2542,6 +2542,7 @@ abbreviations:
<a href="refS.html#stack">stack</a>
<a href="refA.html#adr">adr</a>
<a href="refE.html#env">env</a>
+ <a href="refT.html#trail">trail</a>
<a href="refU.html#up">up</a>
<a href="refD.html#date">date</a>
<a href="refT.html#time">time</a>
diff --git a/doc/refE.html b/doc/refE.html
@@ -210,7 +210,8 @@ href="refV.html#vi">vi</a></code>.
called without arguments, or of the symbols or symbol-value pairs in
<code>lst</code>, or the explicitly given <code>sym</code>-<code>val</code>
arguments. See also <code><a href="refB.html#bind">bind</a></code>, <code><a
-href="refJ.html#job">job</a></code> and <code><a
+href="refJ.html#job">job</a></code>, <code><a
+href="refT.html#trail">trail</a></code> and <code><a
href="refU.html#up">up</a></code>.
<pre><code>
diff --git a/doc/refT.html b/doc/refT.html
@@ -486,6 +486,38 @@ href="refD.html#*Dbg">*Dbg</a></code>.
-> balance
</code></pre>
+<dt><a name="trail"><code>(trail) -> lst</code></a>
+<dd>(64-bit version only) Returns a stack backtrace for the current point of
+program execution, The list elements are either expressions (denoting function
+or method calls), or symbols followed by their corresponding values. See also
+<code><a href="refU.html#up">up</a></code> and <code><a
+href="refE.html#env">env</a></code>.
+
+<pre><code>
+: (de f (A B)
+ (g (inc A) (dec B)) )
+-> f
+: (de g (X Y)
+ (trail) )
+-> g
+: (f 3 4)
+-> ((f 3 4) A 3 B 4 (g (inc A) (dec B)) X 4 Y 3)
+
+: (for (L (f 3 4) L) # Pretty-print trail
+ (if (pair (car L))
+ (println (pop 'L))
+ (space 3)
+ (println (pop 'L) (pop 'L)) ) )
+
+ L NIL
+(f 3 4)
+ A 3
+ B 4
+(g (inc A) (dec B))
+ X 4
+ Y 3
+</code></pre>
+
<dt><a name="tree"><code>(tree 'var 'cls ['hook]) -> tree</code></a>
<dd>Returns a data structure specifying a database index tree. <code>var</code>
and <code>cls</code> determine the relation, with an optional <code>hook</code>
diff --git a/doc/refU.html b/doc/refU.html
@@ -277,9 +277,11 @@ href="refT.html#traceAll">traceAll</a></code>.
<dt><a name="up"><code>(up [cnt] sym ['val]) -> any</code></a>
<dd>Looks up (or modifies) the <code>cnt</code>'th previously saved value of
<code>sym</code> in the corresponding enclosing environment. If <code>cnt</code>
-is not given, 1 is used. See also <code><a
-href="refE.html#eval">eval</a></code>, <code><a
-href="refR.html#run">run</a></code> and <code><a
+is not given, 1 is used. The 64-bit version also allows to omit the
+<code>sym</code> argument, then the corresponding expression (function or method
+call) is returned. See also <code><a href="refE.html#eval">eval</a></code>,
+<code><a href="refR.html#run">run</a></code>, <code><a
+href="refT.html#trail">trail</a></code> and <code><a
href="refE.html#env">env</a></code>.
<pre><code>
@@ -289,6 +291,14 @@ href="refE.html#env">env</a></code>.
: (let N 1 ((quote (N) (println N (up N) (up N 7))) 2) N)
2 1 7
-> 7
+
+: (de foo (N)
+ (println (up)) # 64-bits only
+ (inc N) )
+-> foo
+: (foo 7)
+(foo 7)
+-> 8
</code></pre>
<dt><a name="upd"><code>(upd sym ..) -> lst</code></a>
diff --git a/doc64/structures b/doc64/structures
@@ -1,4 +1,4 @@
-# 07jun12abu
+# 13nov12abu
# (c) Software Lab. Alexander Burger
@@ -128,6 +128,7 @@
Bind frame:
^
+ [exe] |
Bind |
+---> LINK ----+
| val1
@@ -141,6 +142,7 @@
VarArgs frame:
^
+ [exe] |
Bind |
+---> LINK ----+
| val1
diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar
Binary files differ.
diff --git a/lib/map b/lib/map
@@ -1,5 +1,5 @@
-! (2854 . "@src64/flow.l")
-$ (2956 . "@src64/flow.l")
+! (2865 . "@src64/flow.l")
+$ (2967 . "@src64/flow.l")
% (2572 . "@src64/big.l")
& (2807 . "@src64/big.l")
* (2389 . "@src64/big.l")
@@ -28,25 +28,25 @@ accept (145 . "@src64/net.l")
adr (587 . "@src64/main.l")
alarm (473 . "@src64/main.l")
all (788 . "@src64/sym.l")
-and (1613 . "@src64/flow.l")
+and (1624 . "@src64/flow.l")
any (3974 . "@src64/io.l")
append (1338 . "@src64/subr.l")
apply (713 . "@src64/apply.l")
-arg (2369 . "@src64/main.l")
-args (2345 . "@src64/main.l")
-argv (2992 . "@src64/main.l")
+arg (2444 . "@src64/main.l")
+args (2420 . "@src64/main.l")
+argv (3067 . "@src64/main.l")
as (139 . "@src64/flow.l")
asoq (3008 . "@src64/subr.l")
assoc (2973 . "@src64/subr.l")
-at (2098 . "@src64/flow.l")
+at (2109 . "@src64/flow.l")
atom (2385 . "@src64/subr.l")
-bind (1351 . "@src64/flow.l")
+bind (1362 . "@src64/flow.l")
bit? (2748 . "@src64/big.l")
-bool (1713 . "@src64/flow.l")
-box (824 . "@src64/flow.l")
+bool (1724 . "@src64/flow.l")
+box (828 . "@src64/flow.l")
box? (1122 . "@src64/sym.l")
by (1669 . "@src64/apply.l")
-bye (3433 . "@src64/flow.l")
+bye (3444 . "@src64/flow.l")
caaaar (271 . "@src64/subr.l")
caaadr (288 . "@src64/subr.l")
caaar (99 . "@src64/subr.l")
@@ -61,11 +61,11 @@ caddar (409 . "@src64/subr.l")
cadddr (435 . "@src64/subr.l")
caddr (156 . "@src64/subr.l")
cadr (45 . "@src64/subr.l")
-call (3085 . "@src64/flow.l")
+call (3096 . "@src64/flow.l")
car (5 . "@src64/subr.l")
-case (1954 . "@src64/flow.l")
-catch (2456 . "@src64/flow.l")
-cd (2744 . "@src64/main.l")
+case (1965 . "@src64/flow.l")
+catch (2467 . "@src64/flow.l")
+cd (2819 . "@src64/main.l")
cdaaar (464 . "@src64/subr.l")
cdaadr (487 . "@src64/subr.l")
cdaar (179 . "@src64/subr.l")
@@ -88,20 +88,20 @@ circ (816 . "@src64/subr.l")
circ? (2402 . "@src64/subr.l")
clip (1799 . "@src64/subr.l")
close (4387 . "@src64/io.l")
-cmd (2974 . "@src64/main.l")
+cmd (3049 . "@src64/main.l")
cnt (1413 . "@src64/apply.l")
-co (2537 . "@src64/flow.l")
+co (2548 . "@src64/flow.l")
commit (1498 . "@src64/db.l")
con (725 . "@src64/subr.l")
conc (781 . "@src64/subr.l")
-cond (1908 . "@src64/flow.l")
+cond (1919 . "@src64/flow.l")
connect (224 . "@src64/net.l")
cons (747 . "@src64/subr.l")
copy (1225 . "@src64/subr.l")
ctl (4260 . "@src64/io.l")
-ctty (2769 . "@src64/main.l")
+ctty (2844 . "@src64/main.l")
cut (1922 . "@src64/sym.l")
-date (2483 . "@src64/main.l")
+date (2558 . "@src64/main.l")
dbck (2113 . "@src64/db.l")
de (532 . "@src64/flow.l")
dec (2323 . "@src64/big.l")
@@ -111,36 +111,36 @@ del (1977 . "@src64/sym.l")
delete (1401 . "@src64/subr.l")
delq (1452 . "@src64/subr.l")
diff (2589 . "@src64/subr.l")
-dir (2904 . "@src64/main.l")
+dir (2979 . "@src64/main.l")
dm (545 . "@src64/flow.l")
-do (2130 . "@src64/flow.l")
-e (2917 . "@src64/flow.l")
+do (2141 . "@src64/flow.l")
+e (2928 . "@src64/flow.l")
echo (4418 . "@src64/io.l")
env (599 . "@src64/main.l")
eof (3533 . "@src64/io.l")
eol (3524 . "@src64/io.l")
err (4240 . "@src64/io.l")
-errno (1371 . "@src64/main.l")
+errno (1446 . "@src64/main.l")
eval (175 . "@src64/flow.l")
ext (5152 . "@src64/io.l")
ext? (1157 . "@src64/sym.l")
extern (1023 . "@src64/sym.l")
-extra (1258 . "@src64/flow.l")
+extra (1269 . "@src64/flow.l")
extract (1218 . "@src64/apply.l")
fifo (2088 . "@src64/sym.l")
-file (2851 . "@src64/main.l")
+file (2926 . "@src64/main.l")
fill (3243 . "@src64/subr.l")
filter (1161 . "@src64/apply.l")
fin (2033 . "@src64/subr.l")
-finally (2513 . "@src64/flow.l")
+finally (2524 . "@src64/flow.l")
find (1322 . "@src64/apply.l")
fish (1613 . "@src64/apply.l")
flg? (2445 . "@src64/subr.l")
flip (1699 . "@src64/subr.l")
flush (5127 . "@src64/io.l")
fold (3512 . "@src64/sym.l")
-for (2219 . "@src64/flow.l")
-fork (3259 . "@src64/flow.l")
+for (2230 . "@src64/flow.l")
+fork (3270 . "@src64/flow.l")
format (2089 . "@src64/big.l")
free (2055 . "@src64/db.l")
from (3552 . "@src64/io.l")
@@ -160,36 +160,36 @@ hear (3237 . "@src64/io.l")
host (190 . "@src64/net.l")
id (1028 . "@src64/db.l")
idx (2162 . "@src64/sym.l")
-if (1794 . "@src64/flow.l")
-if2 (1813 . "@src64/flow.l")
-ifn (1854 . "@src64/flow.l")
+if (1805 . "@src64/flow.l")
+if2 (1824 . "@src64/flow.l")
+ifn (1865 . "@src64/flow.l")
in (4200 . "@src64/io.l")
inc (2256 . "@src64/big.l")
index (2637 . "@src64/subr.l")
-info (2806 . "@src64/main.l")
+info (2881 . "@src64/main.l")
intern (998 . "@src64/sym.l")
-ipid (3204 . "@src64/flow.l")
-isa (961 . "@src64/flow.l")
-job (1418 . "@src64/flow.l")
+ipid (3215 . "@src64/flow.l")
+isa (967 . "@src64/flow.l")
+job (1429 . "@src64/flow.l")
journal (971 . "@src64/db.l")
key (3385 . "@src64/io.l")
-kill (3236 . "@src64/flow.l")
+kill (3247 . "@src64/flow.l")
last (2044 . "@src64/subr.l")
le0 (2693 . "@src64/big.l")
length (2741 . "@src64/subr.l")
-let (1468 . "@src64/flow.l")
-let? (1529 . "@src64/flow.l")
+let (1479 . "@src64/flow.l")
+let? (1540 . "@src64/flow.l")
lieu (1157 . "@src64/db.l")
line (3708 . "@src64/io.l")
lines (3861 . "@src64/io.l")
link (1172 . "@src64/subr.l")
-lisp (2040 . "@src64/main.l")
+lisp (2115 . "@src64/main.l")
list (887 . "@src64/subr.l")
listen (157 . "@src64/net.l")
lit (150 . "@src64/flow.l")
load (4177 . "@src64/io.l")
lock (1185 . "@src64/db.l")
-loop (2162 . "@src64/flow.l")
+loop (2173 . "@src64/flow.l")
low? (3378 . "@src64/sym.l")
lowc (3408 . "@src64/sym.l")
lst? (2415 . "@src64/subr.l")
@@ -211,8 +211,8 @@ maxi (1511 . "@src64/apply.l")
member (2455 . "@src64/subr.l")
memq (2477 . "@src64/subr.l")
meta (3298 . "@src64/sym.l")
-meth (1089 . "@src64/flow.l")
-method (1053 . "@src64/flow.l")
+meth (1095 . "@src64/flow.l")
+method (1059 . "@src64/flow.l")
min (2356 . "@src64/subr.l")
mini (1562 . "@src64/apply.l")
mix (1260 . "@src64/subr.l")
@@ -221,15 +221,15 @@ n0 (2189 . "@src64/subr.l")
n== (2087 . "@src64/subr.l")
nT (2198 . "@src64/subr.l")
name (502 . "@src64/sym.l")
-nand (1648 . "@src64/flow.l")
-native (1379 . "@src64/main.l")
+nand (1659 . "@src64/flow.l")
+native (1454 . "@src64/main.l")
need (919 . "@src64/subr.l")
-new (835 . "@src64/flow.l")
-next (2352 . "@src64/main.l")
-nil (1731 . "@src64/flow.l")
-nond (1931 . "@src64/flow.l")
-nor (1669 . "@src64/flow.l")
-not (1721 . "@src64/flow.l")
+new (839 . "@src64/flow.l")
+next (2427 . "@src64/main.l")
+nil (1742 . "@src64/flow.l")
+nond (1942 . "@src64/flow.l")
+nor (1680 . "@src64/flow.l")
+not (1732 . "@src64/flow.l")
nth (685 . "@src64/subr.l")
num? (2426 . "@src64/subr.l")
off (1723 . "@src64/sym.l")
@@ -238,9 +238,9 @@ on (1708 . "@src64/sym.l")
onOff (1738 . "@src64/sym.l")
one (1771 . "@src64/sym.l")
open (4344 . "@src64/io.l")
-opid (3220 . "@src64/flow.l")
-opt (3095 . "@src64/main.l")
-or (1629 . "@src64/flow.l")
+opid (3231 . "@src64/flow.l")
+opt (3170 . "@src64/main.l")
+or (1640 . "@src64/flow.l")
out (4220 . "@src64/io.l")
pack (1270 . "@src64/sym.l")
pair (2394 . "@src64/subr.l")
@@ -262,9 +262,9 @@ print (5091 . "@src64/io.l")
println (5122 . "@src64/io.l")
printsp (5107 . "@src64/io.l")
prior (2713 . "@src64/subr.l")
-prog (1749 . "@src64/flow.l")
-prog1 (1757 . "@src64/flow.l")
-prog2 (1774 . "@src64/flow.l")
+prog (1760 . "@src64/flow.l")
+prog1 (1768 . "@src64/flow.l")
+prog2 (1785 . "@src64/flow.l")
prop (2925 . "@src64/sym.l")
protect (509 . "@src64/main.l")
prove (3530 . "@src64/subr.l")
@@ -272,9 +272,9 @@ push (1813 . "@src64/sym.l")
push1 (1849 . "@src64/sym.l")
put (2835 . "@src64/sym.l")
putl (3113 . "@src64/sym.l")
-pwd (2733 . "@src64/main.l")
+pwd (2808 . "@src64/main.l")
queue (2045 . "@src64/sym.l")
-quit (1085 . "@src64/main.l")
+quit (1156 . "@src64/main.l")
quote (134 . "@src64/flow.l")
rand (3003 . "@src64/big.l")
range (997 . "@src64/subr.l")
@@ -283,7 +283,7 @@ raw (451 . "@src64/main.l")
rd (5169 . "@src64/io.l")
read (2665 . "@src64/io.l")
replace (1499 . "@src64/subr.l")
-rest (2398 . "@src64/main.l")
+rest (2473 . "@src64/main.l")
reverse (1678 . "@src64/subr.l")
rewind (5135 . "@src64/io.l")
rollback (1898 . "@src64/db.l")
@@ -292,7 +292,7 @@ run (306 . "@src64/flow.l")
sect (2541 . "@src64/subr.l")
seed (2961 . "@src64/big.l")
seek (1275 . "@src64/apply.l")
-send (1127 . "@src64/flow.l")
+send (1134 . "@src64/flow.l")
seq (1084 . "@src64/db.l")
set (1607 . "@src64/sym.l")
setq (1640 . "@src64/sym.l")
@@ -304,53 +304,54 @@ sp? (727 . "@src64/sym.l")
space (5069 . "@src64/io.l")
split (1592 . "@src64/subr.l")
stack (548 . "@src64/main.l")
-state (1998 . "@src64/flow.l")
+state (2009 . "@src64/flow.l")
stem (1989 . "@src64/subr.l")
str (4028 . "@src64/io.l")
str? (1136 . "@src64/sym.l")
strip (1576 . "@src64/subr.l")
-struct (1831 . "@src64/main.l")
+struct (1906 . "@src64/main.l")
sub? (1569 . "@src64/sym.l")
sum (1460 . "@src64/apply.l")
-super (1214 . "@src64/flow.l")
+super (1225 . "@src64/flow.l")
sym (4014 . "@src64/io.l")
sym? (2434 . "@src64/subr.l")
symbols (942 . "@src64/sym.l")
sync (3197 . "@src64/io.l")
-sys (3056 . "@src64/flow.l")
-t (1740 . "@src64/flow.l")
+sys (3067 . "@src64/flow.l")
+t (1751 . "@src64/flow.l")
tail (1911 . "@src64/subr.l")
tell (3269 . "@src64/io.l")
text (1398 . "@src64/sym.l")
-throw (2482 . "@src64/flow.l")
-tick (3172 . "@src64/flow.l")
+throw (2493 . "@src64/flow.l")
+tick (3183 . "@src64/flow.l")
till (3619 . "@src64/io.l")
-time (2616 . "@src64/main.l")
+time (2691 . "@src64/main.l")
touch (1172 . "@src64/sym.l")
+trail (693 . "@src64/main.l")
trim (1759 . "@src64/subr.l")
-try (1168 . "@src64/flow.l")
-type (914 . "@src64/flow.l")
+try (1177 . "@src64/flow.l")
+type (920 . "@src64/flow.l")
udp (301 . "@src64/net.l")
unify (3938 . "@src64/subr.l")
-unless (1890 . "@src64/flow.l")
-until (2074 . "@src64/flow.l")
-up (693 . "@src64/main.l")
+unless (1901 . "@src64/flow.l")
+until (2085 . "@src64/flow.l")
+up (745 . "@src64/main.l")
upp? (3393 . "@src64/sym.l")
uppc (3460 . "@src64/sym.l")
-use (1562 . "@src64/flow.l")
-usec (2721 . "@src64/main.l")
+use (1573 . "@src64/flow.l")
+usec (2796 . "@src64/main.l")
val (1588 . "@src64/sym.l")
-version (3109 . "@src64/main.l")
+version (3184 . "@src64/main.l")
wait (3159 . "@src64/io.l")
-when (1873 . "@src64/flow.l")
-while (2050 . "@src64/flow.l")
+when (1884 . "@src64/flow.l")
+while (2061 . "@src64/flow.l")
wipe (3253 . "@src64/sym.l")
-with (1321 . "@src64/flow.l")
+with (1332 . "@src64/flow.l")
wr (5252 . "@src64/io.l")
xchg (1663 . "@src64/sym.l")
-xor (1690 . "@src64/flow.l")
+xor (1701 . "@src64/flow.l")
x| (2887 . "@src64/big.l")
-yield (2709 . "@src64/flow.l")
+yield (2720 . "@src64/flow.l")
yoke (1196 . "@src64/subr.l")
zap (1186 . "@src64/sym.l")
zero (1756 . "@src64/sym.l")
diff --git a/src/vers.h b/src/vers.h
@@ -1 +1 @@
-static byte Version[4] = {3,1,0,12};
+static byte Version[4] = {3,1,0,13};
diff --git a/src64/apply.l b/src64/apply.l
@@ -1,4 +1,4 @@
-# 07jun12abu
+# 13nov12abu
# (c) Software Lab. Alexander Burger
(code 'applyXYZ_E 0)
@@ -43,7 +43,7 @@
atom C # Pair?
if z # Yes
# Apply EXPR
- push X
+ push X # Save 'exe'
ld X (C) # Parameter list in X
push (EnvBind) # Build bind frame
link
@@ -80,7 +80,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
- pop X
+ pop X # 'exe'
ret
end
# Non-NIL parameter
@@ -133,7 +133,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
- pop X
+ pop X # 'exe'
ret
end
# Evaluated argument list
@@ -176,7 +176,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
- pop X
+ pop X # 'exe'
ret
end
ld A (C) # Else symbolic, get value
@@ -192,7 +192,6 @@
if nz # Yes
call dbFetchEX # Fetch it
end
- push X
push Z # Save arg pointers
push Y
ld Y C # 'msg'
@@ -203,6 +202,7 @@
xchg (S I) (EnvCls)
xchg Y (S) # 'key'
xchg (S) (EnvKey) # 'key'
+ push X # 'exe'
ld X (C) # Parameter list in X
push (EnvBind) # Build bind frame
link
@@ -242,9 +242,9 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ pop X # 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
- pop X
ret
end
# Non-NIL parameter
@@ -297,9 +297,9 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ pop X # 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
- pop X
ret
end
# Evaluated argument list
@@ -342,9 +342,9 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ pop X # 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
- pop X
ret
end
cmp A (A) # Auto-symbol?
@@ -397,7 +397,7 @@
atom C # Pair?
if z # Yes
# Apply EXPR
- push X
+ push X # Save 'exe'
ld X (C) # Parameter list in X
push (EnvBind) # Build bind frame
link
@@ -434,7 +434,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
- pop X
+ pop X # 'exe'
ret
end
# Non-NIL parameter
@@ -487,7 +487,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
- pop X
+ pop X # 'exe'
ret
end
# Evaluated argument list
@@ -530,7 +530,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
- pop X
+ pop X # 'exe'
ret
end
ld A (C) # Else symbolic, get value
@@ -546,7 +546,6 @@
if nz # Yes
call dbFetchEX # Fetch it
end
- push X
push Z # Save arg pointers
push Y
ld Y C # 'msg'
@@ -557,6 +556,7 @@
xchg (S I) (EnvCls)
xchg Y (S) # 'key'
xchg (S) (EnvKey) # 'key'
+ push X # 'exe'
ld X (C) # Parameter list in X
push (EnvBind) # Build bind frame
link
@@ -596,9 +596,9 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ pop X # 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
- pop X
ret
end
# Non-NIL parameter
@@ -651,9 +651,9 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ pop X # 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
- pop X
ret
end
# Evaluated argument list
@@ -696,9 +696,9 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ pop X # 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
- pop X
ret
end
cmp A (A) # Auto-symbol?
diff --git a/src64/flow.l b/src64/flow.l
@@ -1,4 +1,4 @@
-# 27oct12abu
+# 13nov12abu
# (c) Software Lab. Alexander Burger
(code 'redefMsgEC)
@@ -642,14 +642,15 @@
ret
# Apply METH in C to X, with object A
-(code 'evMethodACXYZ_E 0)
- push Z # <(L) III> 'cls'
- push Y # <(L) II> 'key'
+(code 'evMethodACEXYZ_E 0)
+ cmp S (StkLimit) # Stack check
+ jlt stkErr
+ push Z # <(L) IV> 'cls'
+ push Y # <(L) III> 'key'
ld Y (C) # Parameter list in Y
ld Z (C CDR) # Body in Z
+ push E # Save 'exe'
push (EnvBind) # Build bind frame
- cmp S (StkLimit) # Stack check
- jlt stkErr
link
push (At) # Bind At
push At
@@ -680,8 +681,8 @@
link
ld (EnvBind) L # Close bind frame
push 0 # Init env swap
- xchg (EnvCls) ((L) III) # 'cls'
- xchg (EnvKey) ((L) II) # 'key'
+ xchg (EnvCls) ((L) IV) # 'cls'
+ xchg (EnvKey) ((L) III) # 'key'
prog Z # Run body
add S I # Drop env swap
pop L # Get link
@@ -692,6 +693,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ add S I # Drop 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
ret
@@ -715,8 +717,8 @@
link
ld (EnvBind) L # Close bind frame
push 0 # Init env swap
- xchg (EnvCls) ((L) III) # 'cls'
- xchg (EnvKey) ((L) II) # 'key'
+ xchg (EnvCls) ((L) IV) # 'cls'
+ xchg (EnvKey) ((L) III) # 'key'
prog Z # Run body
add S I # Drop env swap
pop L # Get link
@@ -727,6 +729,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ add S I # Drop 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
ret
@@ -755,8 +758,8 @@
link # Close varArgs frame
end
ld (EnvBind) Y # Close bind frame
- xchg (EnvCls) ((Y) III) # 'cls'
- xchg (EnvKey) ((Y) II) # 'key'
+ xchg (EnvCls) ((Y) IV) # 'cls'
+ xchg (EnvKey) ((Y) III) # 'key'
ld C (Y) # End of bindings in C
add Y I
do
@@ -784,6 +787,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ add S I # Drop 'exe'
pop (EnvKey) # 'key'
pop (EnvCls) # and 'cls'
ret
@@ -836,7 +840,7 @@
push X
push Y
push Z
- ld X E
+ ld Z E # Save 'exe' in Z
ld Y (E CDR) # Y on args
ld E (Y) # Eval first
eval
@@ -879,14 +883,16 @@
ld A (L II) # Object in A
ld (A) E # Set value in 'obj'
end
+ push Z # <S> 'exe'
ld X (Y CDR) # Keep args in X
ld E A # Object
ld Y TSym # Search for initial method
ld Z 0 # No classes
call methodEY_FCYZ # Found?
if eq # Yes
- ld A (L II) # 'obj'
- call evMethodACXYZ_E
+ ld A (L II) # Get 'obj'
+ ld E (S) # and 'exe'
+ call evMethodACEXYZ_E
else
do
atom X # More args?
@@ -1115,8 +1121,9 @@
call methodEY_FCYZ # Found?
jne msgErrYX # No
ld A (L I) # Get 'obj'
+ ld E X # 'exe'
pop X # and args
- call evMethodACXYZ_E
+ call evMethodACEXYZ_E
drop
pop Z
pop Y
@@ -1151,13 +1158,15 @@
if nz # Yes
call dbFetchEX # Fetch it
end
- ld X (Y CDR) # Keep args in X
+ push (Y CDR) # Save args
ld Y (L II) # Get 'msg'
ld Z 0 # No classes
call methodEY_FCYZ # Found?
jne msgErrYX # No
ld A (L I) # Get 'obj'
- call evMethodACXYZ_E
+ ld E X # 'exe'
+ pop X # and args
+ call evMethodACEXYZ_E
drop
pop Z
pop Y
@@ -1194,13 +1203,15 @@
jnz 90 # No
call dbFetchEX # Fetch it
end
- ld X (Y CDR) # Keep args in X
+ push (Y CDR) # Save args
ld Y (L II) # Get 'msg'
ld Z 0 # No classes
call methodEY_FCYZ # Found?
if eq # Yes
ld A (L I) # Get 'obj'
- call evMethodACXYZ_E
+ ld E X # 'exe'
+ ld X (S) # and args
+ call evMethodACEXYZ_E
else
90 ld E Nil
end
diff --git a/src64/glob.l b/src64/glob.l
@@ -1,4 +1,4 @@
-# 02nov12abu
+# 13nov12abu
# (c) Software Lab. Alexander Burger
(data 'Data)
@@ -189,6 +189,7 @@
initFun NIL "stack" doStack
initFun NIL "adr" doAdr
initFun NIL "env" doEnv
+ initFun NIL "trail" doTrail
initFun NIL "up" doUp
initFun NIL "quit" doQuit
initFun NIL "errno" doErrno
diff --git a/src64/main.l b/src64/main.l
@@ -1,4 +1,4 @@
-# 02nov12abu
+# 14nov12abu
# (c) Software Lab. Alexander Burger
(code 'Code)
@@ -689,11 +689,61 @@
pop X
ret
+# (trail) -> lst
+(code 'doTrail 2)
+ ld E Nil # Result
+ push X
+ push Y
+ ld X (EnvBind) # Bindings
+ do
+ null X # Bindings?
+ while nz # Yes
+ ld C (X) # End of bindings
+ null (X -I) # Env swap zero?
+ if z # Yes
+ add X I # X on bindings
+ do
+ ld Y (X) # Next symbol
+ cmp Y At # Lambda frame?
+ if eq # Yes
+ call cons_A # Cons 'exe'
+ ld (A) (C II) # Cons 'exe'
+ ld (A CDR) E
+ ld E A
+ break T
+ end
+ call cons_A # Cons value
+ ld (A) (Y)
+ ld (A CDR) E
+ call consA_E # Cons symbol
+ ld (E) Y
+ ld (E CDR) A
+ ld (Y) (X I) # Set old value
+ add X II # Next entry
+ cmp X C # More?
+ until eq # No
+ end
+ ld X (C I) # Bind link
+ loop
+ ld X E # Restore values
+ do
+ atom X # More?
+ while z # Yes
+ ld Y (X) # Next entry
+ ld X (X CDR)
+ atom Y # Symbol?
+ if nz # Yes
+ ld (Y) (X) # Set old value
+ ld X (X CDR)
+ end
+ loop
+ pop Y
+ pop X
+ ret
+
# (up [cnt] sym ['val]) -> any
(code 'doUp 2)
push X
- push Y
- push Z
ld C 1 # Count
ld E (E CDR) # First arg
ld X (E) # Get 'sym'
@@ -704,6 +754,27 @@
ld E (E CDR) # Skip arg
ld X (E) # 'sym'
end
+ cmp X Nil # NIL?
+ if eq # Yes
+ ld X (EnvBind) # Bindings
+ do
+ null X # Bindings?
+ while nz # Yes
+ ld A (X) # End of bindings in A
+ dec C # Done?
+ if z # Yes
+ ld E (A II) # Return 'exe'
+ pop X
+ ret
+ end
+ ld X (A I) # Bind link
+ loop
+ ld E Nil # Return NIL
+ pop X
+ ret
+ end
+ push Y
+ push Z
ld E (E CDR) # Last arg
ld Y (EnvBind) # Bindings
ld Z X # Value pointer
@@ -1109,6 +1180,7 @@
ld X (E CDR) # Get CDR
ld Y (C) # Parameter list in Y
ld Z (C CDR) # Body in Z
+ push E # Save 'exe'
push (EnvBind) # Build bind frame
link
push (At) # Bind At
@@ -1148,6 +1220,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ add S I # Drop 'exe'
pop Z
pop Y
pop X
@@ -1182,6 +1255,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ add S I # Drop 'exe'
pop Z
pop Y
pop X
@@ -1238,6 +1312,7 @@
until eq # No
pop L # Restore link
pop (EnvBind) # Restore bind link
+ add S I # Drop 'exe'
pop Z
pop Y
pop X
diff --git a/src64/tags b/src64/tags
@@ -16,16 +16,16 @@ AI_NEXT sys/x86-64.linux.defs.l 148
AI_SOCKTYPE sys/x86-64.linux.defs.l 145
AV glob.l 7
AV0 glob.l 8
-Addr glob.l 619
+Addr glob.l 620
Adr glob.l 179
Alarm glob.l 77
-AllocErr glob.l 1162
-ArgErr glob.l 1191
-Arrow glob.l 1178
+AllocErr glob.l 1163
+ArgErr glob.l 1192
+Arrow glob.l 1179
At glob.l 159
At2 glob.l 160
At3 glob.l 161
-AtomErr glob.l 1197
+AtomErr glob.l 1198
Avail glob.l 11
BEG defs.l 44
BIG defs.l 35
@@ -34,15 +34,15 @@ BLKSIZE defs.l 54
BLKTAG defs.l 55
BSym glob.l 155
BUFSIZ sys/x86-64.linux.defs.l 26
-BadChain glob.l 1183
-BadCount glob.l 1184
-BadDot glob.l 1217
-BadFdErr glob.l 1212
-BadInput glob.l 1216
+BadChain glob.l 1184
+BadCount glob.l 1185
+BadDot glob.l 1218
+BadFdErr glob.l 1213
+BadInput glob.l 1217
BlkIndex glob.l 68
BlkLink glob.l 69
Break glob.l 50
-BrkErr glob.l 1206
+BrkErr glob.l 1207
Buf glob.l 12
BufEnd glob.l 54
Bye glob.l 181
@@ -58,19 +58,19 @@ CSym glob.l 154
C_CC sys/x86-64.linux.defs.l 73
C_IFLAG sys/x86-64.linux.defs.l 71
C_LFLAG sys/x86-64.linux.defs.l 72
-CaseBlocks glob.l 626
-CaseData glob.l 756
-CaseLower glob.l 1117
-CaseUpper glob.l 1093
+CaseBlocks glob.l 627
+CaseData glob.l 757
+CaseLower glob.l 1118
+CaseUpper glob.l 1094
Catch glob.l 20
-CbErr glob.l 1165
+CbErr glob.l 1166
Child glob.l 44
Children glob.l 43
-Chr glob.l 587
-CircFree glob.l 1182
+Chr glob.l 588
+CircFree glob.l 1183
Class glob.l 168
-CloseErr glob.l 1208
-CntErr glob.l 1193
+CloseErr glob.l 1209
+CntErr glob.l 1194
Code main.l 4
DB glob.l 145
DB1 defs.l 11
@@ -78,24 +78,24 @@ DBs glob.l 63
DIG defs.l 36
DOT defs.l 45
D_NAME sys/x86-64.linux.defs.l 122
-Dashes glob.l 1187
+Dashes glob.l 1188
Data glob.l 4
-Db1 glob.l 566
+Db1 glob.l 567
DbBlock glob.l 66
DbFile glob.l 64
DbFiles glob.l 65
DbJnl glob.l 70
DbLog glob.l 71
-DbRdErr glob.l 1231
-DbSizErr glob.l 1233
-DbSyncErr glob.l 1225
-DbWrErr glob.l 1232
-DbfErr glob.l 1228
+DbRdErr glob.l 1232
+DbSizErr glob.l 1234
+DbSyncErr glob.l 1226
+DbWrErr glob.l 1233
+DbfErr glob.l 1229
Dbg glob.l 164
-Delim glob.l 1176
-DelimEnd glob.l 1177
-DivErr glob.l 1200
-DlErr glob.l 1243
+Delim glob.l 1177
+DelimEnd glob.l 1178
+DivErr glob.l 1201
+DlErr glob.l 1244
EACCES sys/x86-64.linux.defs.l 9
EAGAIN sys/x86-64.linux.defs.l 8
EBADF sys/x86-64.linux.defs.l 7
@@ -105,40 +105,40 @@ END defs.l 46
ENOENT sys/x86-64.linux.defs.l 5
EPIPE sys/x86-64.linux.defs.l 10
EXTERN defs.l 50
-Env glob.l 592
-EnvApply glob.l 603
-EnvArgs glob.l 599
-EnvBind glob.l 593
-EnvCls glob.l 601
-EnvCo glob.l 586
-EnvCo7 glob.l 610
-EnvCtlFrames glob.l 597
-EnvEnd glob.l 614
-EnvErrFrames glob.l 596
-EnvInFrames glob.l 594
-EnvIntern glob.l 598
-EnvKey glob.l 602
-EnvMake glob.l 604
-EnvMid glob.l 609
-EnvNext glob.l 600
-EnvOutFrames glob.l 595
-EnvParseC glob.l 607
-EnvParseEOF glob.l 608
-EnvParseX glob.l 606
-EnvProtect glob.l 612
-EnvTask glob.l 611
-EnvTrace glob.l 613
-EnvYoke glob.l 605
-EofErr glob.l 1214
+Env glob.l 593
+EnvApply glob.l 604
+EnvArgs glob.l 600
+EnvBind glob.l 594
+EnvCls glob.l 602
+EnvCo glob.l 587
+EnvCo7 glob.l 611
+EnvCtlFrames glob.l 598
+EnvEnd glob.l 615
+EnvErrFrames glob.l 597
+EnvInFrames glob.l 595
+EnvIntern glob.l 599
+EnvKey glob.l 603
+EnvMake glob.l 605
+EnvMid glob.l 610
+EnvNext glob.l 601
+EnvOutFrames glob.l 596
+EnvParseC glob.l 608
+EnvParseEOF glob.l 609
+EnvParseX glob.l 607
+EnvProtect glob.l 613
+EnvTask glob.l 612
+EnvTrace glob.l 614
+EnvYoke glob.l 606
+EofErr glob.l 1215
Err glob.l 174
-ErrTok glob.l 1186
-ExecErr glob.l 1161
+ErrTok glob.l 1187
+ExecErr glob.l 1162
Ext glob.l 166
-ExtErr glob.l 1195
+ExtErr glob.l 1196
ExtN glob.l 45
-Extern glob.l 568
+Extern glob.l 569
Extn glob.l 46
-ExtraErr glob.l 1170
+ExtraErr glob.l 1171
FD_CLOEXEC sys/x86-64.linux.defs.l 23
FD_SET sys/x86-64.linux.defs.l 111
FLOCK sys/x86-64.linux.defs.l 36
@@ -153,18 +153,18 @@ F_SETLKW sys/x86-64.linux.defs.l 51
F_SETOWN sys/x86-64.linux.defs.l 52
F_UNLCK sys/x86-64.linux.defs.l 46
F_WRLCK sys/x86-64.linux.defs.l 45
-Flock glob.l 617
+Flock glob.l 618
Fork glob.l 180
-ForkErr glob.l 1210
+ForkErr glob.l 1211
GcCount glob.l 51
GcMark glob.l 74
GcMarkEnd glob.l 129
-GcSymEnd glob.l 572
+GcSymEnd glob.l 573
GetBinZ_FB glob.l 30
-Get_A glob.l 589
-Giveup glob.l 1160
+Get_A glob.l 590
+Giveup glob.l 1161
HEAP defs.l 5
-HashBlank glob.l 1167
+HashBlank glob.l 1168
Heaps glob.l 10
Hear glob.l 39
Home glob.l 9
@@ -180,20 +180,20 @@ ISIG sys/x86-64.linux.defs.l 74
ISym glob.l 151
IV defs.l 17
IX defs.l 22
-IdErr glob.l 1230
-IgnLog glob.l 1181
-InBye glob.l 1147
+IdErr glob.l 1231
+IgnLog glob.l 1182
+InBye glob.l 1148
InFDs glob.l 25
-InFile glob.l 590
+InFile glob.l 591
InFiles glob.l 26
-IpBindErr glob.l 1239
-IpGetsocknameErr glob.l 1236
-IpListenErr glob.l 1240
-IpReuseaddrErr glob.l 1238
-IpSocketErr glob.l 1235
-IpV6onlyErr glob.l 1237
-Jam glob.l 1146
-JnlErr glob.l 1229
+IpBindErr glob.l 1240
+IpGetsocknameErr glob.l 1237
+IpListenErr glob.l 1241
+IpReuseaddrErr glob.l 1239
+IpSocketErr glob.l 1236
+IpV6onlyErr glob.l 1238
+Jam glob.l 1147
+JnlErr glob.l 1230
L_LEN sys/x86-64.linux.defs.l 40
L_PID sys/x86-64.linux.defs.l 41
L_START sys/x86-64.linux.defs.l 39
@@ -205,25 +205,25 @@ LineX glob.l 79
Link glob.l 19
Lisp glob.l 80
LispEnd glob.l 128
-LockErr glob.l 1227
-LstErr glob.l 1198
+LockErr glob.l 1228
+LstErr glob.l 1199
MAXPATHLEN sys/x86-64.linux.defs.l 29
-MakeErr glob.l 1202
+MakeErr glob.l 1203
MaxBlkSize glob.l 67
Meth glob.l 146
Mic glob.l 37
-Month glob.l 1149
+Month glob.l 1150
Msg glob.l 175
-MsgErr glob.l 1205
+MsgErr glob.l 1206
NIX defs.l 43
NI_MAXHOST sys/x86-64.linux.defs.l 135
NI_NAMEREQD sys/x86-64.linux.defs.l 136
NSym glob.l 152
NUMBER defs.l 47
Nil glob.l 134
-NoFdErr glob.l 1213
+NoFdErr glob.l 1214
NoMemory main.l 211
-NumErr glob.l 1192
+NumErr glob.l 1193
ONE defs.l 9
OS glob.l 144
O_APPEND sys/x86-64.linux.defs.l 20
@@ -235,33 +235,33 @@ O_RDONLY sys/x86-64.linux.defs.l 14
O_RDWR sys/x86-64.linux.defs.l 16
O_TRUNC sys/x86-64.linux.defs.l 19
O_WRONLY sys/x86-64.linux.defs.l 15
-OpenErr glob.l 1207
-OrgTermio glob.l 616
+OpenErr glob.l 1208
+OrgTermio glob.l 617
OutFDs glob.l 27
-OutFile glob.l 591
+OutFile glob.l 592
OutFiles glob.l 28
PIPE_BUF sys/x86-64.linux.defs.l 27
PPid glob.l 157
-PRepl glob.l 1145
-PairErr glob.l 1196
+PRepl glob.l 1146
+PairErr glob.l 1197
Penv glob.l 56
Pico glob.l 137
Pid glob.l 158
-PidSigMsg glob.l 1163
-PipeErr glob.l 1209
+PidSigMsg glob.l 1164
+PipeErr glob.l 1210
Pnl glob.l 57
Prompt glob.l 163
-ProtErr glob.l 1188
-PutB glob.l 588
+ProtErr glob.l 1189
+PutB glob.l 589
PutBinBZ glob.l 29
-QuitMsg glob.l 1164
+QuitMsg glob.l 1165
Quote glob.l 147
RTLD_GLOBAL sys/x86-64.linux.defs.l 33
RTLD_LAZY sys/x86-64.linux.defs.l 32
-Redefined glob.l 1168
-ReentErr glob.l 1203
-RenErr glob.l 1201
-Repl glob.l 1144
+Redefined glob.l 1169
+ReentErr glob.l 1204
+RenErr glob.l 1202
+Repl glob.l 1145
Ret main.l 8
RetE_E main.l 28
RetNil main.l 22
@@ -270,7 +270,7 @@ Retc main.l 10
Retnc main.l 13
Retnz main.l 19
Retz main.l 16
-RolbLog glob.l 1180
+RolbLog glob.l 1181
Run glob.l 169
SA_FLAGS sys/x86-64.linux.defs.l 84
SA_HANDLER sys/x86-64.linux.defs.l 82
@@ -317,10 +317,10 @@ S_IFDIR sys/x86-64.linux.defs.l 62
S_IFMT sys/x86-64.linux.defs.l 61
Scl glob.l 167
Seed glob.l 31
-SelectErr glob.l 1218
+SelectErr glob.l 1219
Sep0 glob.l 52
Sep3 glob.l 53
-SetFD glob.l 1175
+SetFD glob.l 1176
Sig1 glob.l 171
Sig2 glob.l 172
Sigio glob.l 78
@@ -331,20 +331,20 @@ SpMiPipe glob.l 38
Spkr glob.l 36
Stack0 glob.l 15
Stacks glob.l 16
-StkErr glob.l 1190
+StkErr glob.l 1191
StkLimit glob.l 18
StkSize glob.l 17
StrC glob.l 48
StrX glob.l 47
-SuparErr glob.l 1215
-SuperErr glob.l 1169
-SymErr glob.l 1194
-SymNsErr glob.l 1189
+SuparErr glob.l 1216
+SuperErr glob.l 1170
+SymErr glob.l 1195
+SymNsErr glob.l 1190
SymTab glob.l 133
-SymTabEnd glob.l 558
-Sync glob.l 1148
+SymTabEnd glob.l 559
+Sync glob.l 1149
TAIL defs.l 40
-TBuf glob.l 621
+TBuf glob.l 622
TCSADRAIN sys/x86-64.linux.defs.l 77
TERMIOS sys/x86-64.linux.defs.l 70
TMS sys/x86-64.linux.defs.l 65
@@ -362,28 +362,28 @@ TSym glob.l 148
Talking glob.l 42
Tell glob.l 40
TellBuf glob.l 41
-TellErr glob.l 1234
+TellErr glob.l 1235
Termio glob.l 21
-TgCPU glob.l 561
-TgOS glob.l 562
+TgCPU glob.l 562
+TgOS glob.l 563
This glob.l 162
-ThrowErr glob.l 1171
+ThrowErr glob.l 1172
TickS glob.l 34
TickU glob.l 33
Time glob.l 22
-Tio glob.l 1142
-Tms glob.l 618
-TrSyncErr glob.l 1226
+Tio glob.l 1143
+Tms glob.l 619
+TrSyncErr glob.l 1227
Transient glob.l 75
-Trc1 glob.l 1172
-Trc2 glob.l 1173
-TruncErr glob.l 1224
+Trc1 glob.l 1173
+Trc2 glob.l 1174
+TruncErr glob.l 1225
Tsm glob.l 178
TtyPid glob.l 24
UDPMAX defs.l 58
USec glob.l 23
-UdpOvflErr glob.l 1241
-UndefErr glob.l 1242
+UdpOvflErr glob.l 1242
+UndefErr glob.l 1243
Uni glob.l 176
Up glob.l 173
V defs.l 18
@@ -392,24 +392,24 @@ VII defs.l 20
VIII defs.l 21
VMIN sys/x86-64.linux.defs.l 75
VTIME sys/x86-64.linux.defs.l 76
-VarErr glob.l 1199
-Version glob.l 575
+VarErr glob.l 1200
+Version glob.l 576
WNOHANG sys/x86-64.linux.defs.l 107
WUNTRACED sys/x86-64.linux.defs.l 108
-WaitPidErr glob.l 1211
-WrBytesErr glob.l 1219
-WrChildErr glob.l 1220
-WrJnlErr glob.l 1222
-WrLogErr glob.l 1223
-WrSyncErr glob.l 1221
-YieldErr glob.l 1204
+WaitPidErr glob.l 1212
+WrBytesErr glob.l 1220
+WrChildErr glob.l 1221
+WrJnlErr glob.l 1223
+WrLogErr glob.l 1224
+WrSyncErr glob.l 1222
+YieldErr glob.l 1205
ZERO defs.l 8
Zap glob.l 165
-_a_ glob.l 1154
-_ap_ glob.l 1155
-_dot_ glob.l 1156
-_r_ glob.l 1152
-_w_ glob.l 1153
+_a_ glob.l 1155
+_ap_ glob.l 1156
+_dot_ glob.l 1157
+_r_ glob.l 1153
+_w_ glob.l 1154
addAE_A big.l 1517
adduAE_A big.l 540
allocAE_A main.l 207
@@ -427,12 +427,12 @@ badFdErrEX err.l 531
badInputErrB err.l 551
balanceCEY sym.l 910
balanceXY sym.l 892
-begString main.l 2307
+begString main.l 2382
binPrintEZ io.l 731
binReadZ_FE io.l 520
blkPeekCEZ db.l 392
blkPokeCEZ db.l 403
-boxE_E main.l 2275
+boxE_E main.l 2350
boxNumA_A gc.l 872
boxNumE_E gc.l 886
boxNum_A gc.l 824
@@ -440,45 +440,45 @@ boxNum_C gc.l 836
boxNum_E gc.l 848
boxNum_X gc.l 860
brkErrX err.l 500
-brkLoadE_E flow.l 2862
+brkLoadE_E flow.l 2873
bufAoAC_C db.l 956
bufStringE_SZ io.l 1143
-byeE flow.l 3445
+byeE flow.l 3456
byteNumBCX_CX io.l 464
byteSymBCX_CX io.l 1293
caseDataA_AC sym.l 3366
-caught flow.l 2472
-cbl main.l 1909
-cbl1 main.l 1942
-cbl10 main.l 1978
-cbl11 main.l 1982
-cbl12 main.l 1986
-cbl13 main.l 1990
-cbl14 main.l 1994
-cbl15 main.l 1998
-cbl16 main.l 2002
-cbl17 main.l 2006
-cbl18 main.l 2010
-cbl19 main.l 2014
-cbl2 main.l 1946
-cbl20 main.l 2018
-cbl21 main.l 2022
-cbl22 main.l 2026
-cbl23 main.l 2030
-cbl24 main.l 2034
-cbl3 main.l 1950
-cbl4 main.l 1954
-cbl5 main.l 1958
-cbl6 main.l 1962
-cbl7 main.l 1966
-cbl8 main.l 1970
-cbl9 main.l 1974
+caught flow.l 2483
+cbl main.l 1984
+cbl1 main.l 2017
+cbl10 main.l 2053
+cbl11 main.l 2057
+cbl12 main.l 2061
+cbl13 main.l 2065
+cbl14 main.l 2069
+cbl15 main.l 2073
+cbl16 main.l 2077
+cbl17 main.l 2081
+cbl18 main.l 2085
+cbl19 main.l 2089
+cbl2 main.l 2021
+cbl20 main.l 2093
+cbl21 main.l 2097
+cbl22 main.l 2101
+cbl23 main.l 2105
+cbl24 main.l 2109
+cbl3 main.l 2025
+cbl4 main.l 2029
+cbl5 main.l 2033
+cbl6 main.l 2037
+cbl7 main.l 2041
+cbl8 main.l 2045
+cbl9 main.l 2049
charSymACX_CX io.l 1258
checkVarAX err.l 371
checkVarEX err.l 387
checkVarYX err.l 379
chopExtNmX_E db.l 133
-circE_YF main.l 740
+circE_YF main.l 811
cleanUpY db.l 570
closeAX io.l 5
closeErrEX err.l 512
@@ -495,7 +495,7 @@ cmpuAE_F big.l 1587
cntErrAX err.l 424
cntErrCX err.l 426
cntErrEX err.l 428
-compareAE_F main.l 905
+compareAE_F main.l 976
consAC_E gc.l 786
consA_A gc.l 530
consA_C gc.l 594
@@ -533,8 +533,8 @@ cons_Z gc.l 518
ctOpenEXY io.l 1672
currFdX_C io.l 1335
currFd_C io.l 1339
-cutLocalCX flow.l 2830
-dateXYZ_E main.l 2422
+cutLocalCX flow.l 2841
+dateXYZ_E main.l 2497
dbAEX db.l 1331
dbFetchEX db.l 1319
dbFileBlkY_AC db.l 246
@@ -560,30 +560,30 @@ doAdd big.l 2171
doAdr main.l 587
doAlarm main.l 473
doAll sym.l 788
-doAnd flow.l 1613
+doAnd flow.l 1624
doAny io.l 3974
doAppend subr.l 1338
doApply apply.l 713
-doArg main.l 2369
-doArgs main.l 2345
-doArgv main.l 2992
+doArg main.l 2444
+doArgs main.l 2420
+doArgv main.l 3067
doArrow subr.l 3916
doAs flow.l 139
doAsoq subr.l 3008
doAssoc subr.l 2973
-doAt flow.l 2098
+doAt flow.l 2109
doAtom subr.l 2385
-doBind flow.l 1351
+doBind flow.l 1362
doBitAnd big.l 2807
doBitOr big.l 2847
doBitQ big.l 2748
doBitXor big.l 2887
-doBool flow.l 1713
-doBox flow.l 824
+doBool flow.l 1724
+doBox flow.l 828
doBoxQ sym.l 1122
-doBreak flow.l 2854
+doBreak flow.l 2865
doBy apply.l 1669
-doBye flow.l 3433
+doBye flow.l 3444
doCaaaar subr.l 271
doCaaadr subr.l 288
doCaaar subr.l 99
@@ -598,11 +598,11 @@ doCaddar subr.l 409
doCadddr subr.l 435
doCaddr subr.l 156
doCadr subr.l 45
-doCall flow.l 3085
+doCall flow.l 3096
doCar subr.l 5
-doCase flow.l 1954
-doCatch flow.l 2456
-doCd main.l 2744
+doCase flow.l 1965
+doCatch flow.l 2467
+doCd main.l 2819
doCdaaar subr.l 464
doCdaadr subr.l 487
doCdaar subr.l 179
@@ -625,21 +625,21 @@ doCirc subr.l 816
doCircQ subr.l 2402
doClip subr.l 1799
doClose io.l 4387
-doCmd main.l 2974
+doCmd main.l 3049
doCnt apply.l 1413
-doCo flow.l 2537
+doCo flow.l 2548
doCol sym.l 3051
doCommit db.l 1498
doCon subr.l 725
doConc subr.l 781
-doCond flow.l 1908
+doCond flow.l 1919
doConnect net.l 224
doCons subr.l 747
doCopy subr.l 1225
doCtl io.l 4260
-doCtty main.l 2769
+doCtty main.l 2844
doCut sym.l 1922
-doDate main.l 2483
+doDate main.l 2558
doDbck db.l 2113
doDe flow.l 532
doDec big.l 2323
@@ -649,11 +649,11 @@ doDel sym.l 1977
doDelete subr.l 1401
doDelq subr.l 1452
doDiff subr.l 2589
-doDir main.l 2904
+doDir main.l 2979
doDiv big.l 2513
doDm flow.l 545
-doDo flow.l 2130
-doE flow.l 2917
+doDo flow.l 2141
+doE flow.l 2928
doEcho io.l 4418
doEnv main.l 599
doEof io.l 3533
@@ -663,27 +663,27 @@ doEq0 subr.l 2173
doEqT subr.l 2181
doEqual subr.l 2115
doErr io.l 4240
-doErrno main.l 1371
+doErrno main.l 1446
doEval flow.l 175
doExt io.l 5152
doExtQ sym.l 1157
doExtern sym.l 1023
-doExtra flow.l 1258
+doExtra flow.l 1269
doExtract apply.l 1218
doFifo sym.l 2088
-doFile main.l 2851
+doFile main.l 2926
doFill subr.l 3243
doFilter apply.l 1161
doFin subr.l 2033
-doFinally flow.l 2513
+doFinally flow.l 2524
doFind apply.l 1322
doFish apply.l 1613
doFlgQ subr.l 2445
doFlip subr.l 1699
doFlush io.l 5127
doFold sym.l 3512
-doFor flow.l 2219
-doFork flow.l 3259
+doFor flow.l 2230
+doFork flow.l 3270
doFormat big.l 2089
doFree db.l 2055
doFrom io.l 3552
@@ -706,37 +706,37 @@ doHide sym.l 1090
doHost net.l 190
doId db.l 1028
doIdx sym.l 2162
-doIf flow.l 1794
-doIf2 flow.l 1813
-doIfn flow.l 1854
+doIf flow.l 1805
+doIf2 flow.l 1824
+doIfn flow.l 1865
doIn io.l 4200
doInc big.l 2256
doIndex subr.l 2637
-doInfo main.l 2806
+doInfo main.l 2881
doIntern sym.l 998
-doIpid flow.l 3204
-doIsa flow.l 961
-doJob flow.l 1418
+doIpid flow.l 3215
+doIsa flow.l 967
+doJob flow.l 1429
doJournal db.l 971
doKey io.l 3385
-doKill flow.l 3236
+doKill flow.l 3247
doLast subr.l 2044
doLe subr.l 2237
doLe0 big.l 2693
doLength subr.l 2741
-doLet flow.l 1468
-doLetQ flow.l 1529
+doLet flow.l 1479
+doLetQ flow.l 1540
doLieu db.l 1157
doLine io.l 3708
doLines io.l 3861
doLink subr.l 1172
-doLisp main.l 2040
+doLisp main.l 2115
doList subr.l 887
doListen net.l 157
doLit flow.l 150
doLoad io.l 4177
doLock db.l 1185
-doLoop flow.l 2162
+doLoop flow.l 2173
doLowQ sym.l 3378
doLowc sym.l 3408
doLstQ subr.l 2415
@@ -759,8 +759,8 @@ doMaxi apply.l 1511
doMember subr.l 2455
doMemq subr.l 2477
doMeta sym.l 3298
-doMeth flow.l 1089
-doMethod flow.l 1053
+doMeth flow.l 1095
+doMethod flow.l 1059
doMin subr.l 2356
doMini apply.l 1562
doMix subr.l 1260
@@ -772,15 +772,15 @@ doNEq0 subr.l 2189
doNEqT subr.l 2198
doNEqual subr.l 2144
doName sym.l 502
-doNand flow.l 1648
-doNative main.l 1379
+doNand flow.l 1659
+doNative main.l 1454
doNeed subr.l 919
-doNew flow.l 835
-doNext main.l 2352
-doNil flow.l 1731
-doNond flow.l 1931
-doNor flow.l 1669
-doNot flow.l 1721
+doNew flow.l 839
+doNext main.l 2427
+doNil flow.l 1742
+doNond flow.l 1942
+doNor flow.l 1680
+doNot flow.l 1732
doNth subr.l 685
doNumQ subr.l 2426
doOff sym.l 1723
@@ -789,9 +789,9 @@ doOn sym.l 1708
doOnOff sym.l 1738
doOne sym.l 1771
doOpen io.l 4344
-doOpid flow.l 3220
-doOpt main.l 3095
-doOr flow.l 1629
+doOpid flow.l 3231
+doOpt main.l 3170
+doOr flow.l 1640
doOut io.l 4220
doPack sym.l 1270
doPair subr.l 2394
@@ -813,9 +813,9 @@ doPrint io.l 5091
doPrintln io.l 5122
doPrintsp io.l 5107
doPrior subr.l 2713
-doProg flow.l 1749
-doProg1 flow.l 1757
-doProg2 flow.l 1774
+doProg flow.l 1760
+doProg1 flow.l 1768
+doProg2 flow.l 1785
doProp sym.l 2925
doPropCol sym.l 3075
doProtect main.l 509
@@ -824,9 +824,9 @@ doPush sym.l 1813
doPush1 sym.l 1849
doPut sym.l 2835
doPutl sym.l 3113
-doPwd main.l 2733
+doPwd main.l 2808
doQueue sym.l 2045
-doQuit main.l 1085
+doQuit main.l 1156
doQuote flow.l 134
doRand big.l 3003
doRange subr.l 997
@@ -836,7 +836,7 @@ doRd io.l 5169
doRead io.l 2665
doRem big.l 2572
doReplace subr.l 1499
-doRest main.l 2398
+doRest main.l 2473
doReverse subr.l 1678
doRewind io.l 5135
doRollback db.l 1898
@@ -846,7 +846,7 @@ doSect subr.l 2541
doSeed big.l 2961
doSeek apply.l 1275
doSemicol sym.l 2970
-doSend flow.l 1127
+doSend flow.l 1134
doSeq db.l 1084
doSet sym.l 1607
doSetCol sym.l 2999
@@ -860,90 +860,91 @@ doSpQ sym.l 727
doSpace io.l 5069
doSplit subr.l 1592
doStack main.l 548
-doState flow.l 1998
+doState flow.l 2009
doStem subr.l 1989
doStr io.l 4028
doStrQ sym.l 1136
doStrip subr.l 1576
-doStruct main.l 1831
+doStruct main.l 1906
doSub big.l 2209
doSubQ sym.l 1569
doSum apply.l 1460
-doSuper flow.l 1214
+doSuper flow.l 1225
doSym io.l 4014
doSymQ subr.l 2434
doSymbols sym.l 942
doSync io.l 3197
-doSys flow.l 3056
-doT flow.l 1740
+doSys flow.l 3067
+doT flow.l 1751
doTail subr.l 1911
doTell io.l 3269
doText sym.l 1398
-doThrow flow.l 2482
-doTick flow.l 3172
+doThrow flow.l 2493
+doTick flow.l 3183
doTill io.l 3619
-doTime main.l 2616
+doTime main.l 2691
doTouch sym.l 1172
-doTrace flow.l 2956
+doTrace flow.l 2967
+doTrail main.l 693
doTrim subr.l 1759
-doTry flow.l 1168
-doType flow.l 914
+doTry flow.l 1177
+doType flow.l 920
doUdp net.l 301
doUnify subr.l 3938
-doUnless flow.l 1890
-doUntil flow.l 2074
-doUp main.l 693
+doUnless flow.l 1901
+doUntil flow.l 2085
+doUp main.l 745
doUppQ sym.l 3393
doUppc sym.l 3460
-doUse flow.l 1562
-doUsec main.l 2721
+doUse flow.l 1573
+doUsec main.l 2796
doVal sym.l 1588
-doVersion main.l 3109
+doVersion main.l 3184
doWait io.l 3159
-doWhen flow.l 1873
-doWhile flow.l 2050
+doWhen flow.l 1884
+doWhile flow.l 2061
doWipe sym.l 3253
-doWith flow.l 1321
+doWith flow.l 1332
doWr io.l 5252
doXchg sym.l 1663
-doXor flow.l 1690
-doYield flow.l 2709
+doXor flow.l 1701
+doYield flow.l 2720
doYoke subr.l 1196
doZap sym.l 1186
doZero sym.l 1756
-endString_E main.l 2318
+endString_E main.l 2393
eofErr err.l 540
eolA_F io.l 3693
-equalAE_F main.l 772
+equalAE_F main.l 843
erOpenEXY io.l 1630
errEXYZ err.l 33
errnoC sys/x86-64.linux.code.l 10
errnoEXY err.l 24
errno_A sys/x86-64.linux.code.l 5
-evCntEX_FE main.l 2246
-evCntXY_FE main.l 2244
-evExprCE_E main.l 1103
-evListE_E main.l 1247
-evMethodACXYZ_E flow.l 645
-evSymE_E main.l 2221
-evSymX_E main.l 2216
-evSymY_E main.l 2219
-execE main.l 2130
+evCntEX_FE main.l 2321
+evCntXY_FE main.l 2319
+evExprCE_E main.l 1174
+evListE_E main.l 1322
+evMethodACEXYZ_E flow.l 645
+evSymE_E main.l 2296
+evSymX_E main.l 2291
+evSymY_E main.l 2294
+execE main.l 2205
execErrS main.l 187
extErrEX err.l 440
extNmCE_X db.l 64
externX_E sym.l 266
-extraXY_FCYZ flow.l 1285
+extraXY_FCYZ flow.l 1296
fdRdSetCZL io.l 2727
fdSetCL_X io.l 2715
fdSetC_Y io.l 3318
fdWrSetCZL io.l 2734
-fetchCharC_AC main.l 1874
+fetchCharC_AC main.l 1949
fileObjE_AC db.l 237
fileObjX_AC db.l 211
fillE_FE subr.l 3261
findSymX_E sym.l 257
-finishE flow.l 3457
+finishE flow.l 3468
firstByteA_B sym.l 673
firstCharE_A sym.l 688
fishAXY apply.l 1640
@@ -954,9 +955,9 @@ fmtNumAE_E big.l 1797
fmtScaleCX_CX big.l 2061
fmtWordACX_CX big.l 2046
forkErrX err.l 521
-forkLispX_FE flow.l 3272
+forkLispX_FE flow.l 3283
fsyncDB db.l 932
-funqE_FE main.l 2154
+funqE_FE main.l 2229
gc gc.l 65
getAdrZ_A db.l 6
getBinaryZ_FB io.l 448
@@ -994,11 +995,11 @@ isBlankE_F sym.l 704
isInternEXY_F sym.l 37
isLetterOrDigitA_F sym.l 3584
isLifeE_F db.l 525
-isaCE_F flow.l 1012
+isaCE_F flow.l 1018
jnlErrX err.l 624
jnlFileno_A db.l 344
-joinLocalCX flow.l 2843
-lisp main.l 2084
+joinLocalCX flow.l 2854
+lisp main.l 2159
loadAllX_E main.l 162
loadBEX_E io.l 4081
lockErr err.l 613
@@ -1007,8 +1008,8 @@ lockJnl db.l 352
logBlock db.l 432
logFileno_A db.l 348
lookupCE_E subr.l 3872
-loopX flow.l 2167
-loopY_FE flow.l 2406
+loopX flow.l 2178
+loopY_FE flow.l 2417
lstErrAX err.l 456
lstErrEX err.l 458
lupCE_E subr.l 3815
@@ -1016,13 +1017,13 @@ main main.l 33
makeErrX err.l 477
markE gc.l 5
matchCE_F subr.l 3147
-memberXY_FY main.l 1067
+memberXY_FY main.l 1138
metaCX_E sym.l 3340
-methodEY_FCYZ flow.l 791
+methodEY_FCYZ flow.l 795
mkCharA_A sym.l 573
mkStrEZ_A sym.l 650
mkStrE_E sym.l 623
-msec_A main.l 2332
+msec_A main.l 2407
msgErrAX err.l 494
msgErrEX err.l 496
msgErrYX err.l 492
@@ -1031,8 +1032,8 @@ nameA_A sym.l 469
nameE_E sym.l 477
nameX_X sym.l 485
nameY_Y sym.l 493
-natBufACZ_CZ main.l 1583
-natRetACE_CE main.l 1682
+natBufACZ_CZ main.l 1658
+natRetACE_CE main.l 1757
needC gc.l 54
needSymAX err.l 329
needSymEX err.l 341
@@ -1090,7 +1091,7 @@ putACE sym.l 2491
putBlockBZ db.l 612
putSrcEC_E flow.l 25
putStdoutB io.l 4631
-putStringB main.l 2295
+putStringB main.l 2370
putTellBZ io.l 997
putUdpBZ net.l 377
rdAtomBY_E io.l 2119
@@ -1116,7 +1117,7 @@ remUnder big.l 1485
remuAE_A big.l 1266
renErrEX err.l 473
restart main.l 154
-resumeCoroutine flow.l 2563
+resumeCoroutine flow.l 2574
ret err.l 711
retE_E err.l 734
retNil err.l 728
@@ -1127,7 +1128,7 @@ retnc err.l 716
retnz err.l 722
retz err.l 719
rewindLog db.l 928
-runE_E main.l 2142
+runE_E main.l 2217
rwUnlockDbA db.l 269
selectErrX err.l 564
serverCEY_FE net.l 273
@@ -1137,7 +1138,7 @@ setBlkAC_Z db.l 366
setBlockAC_Z db.l 364
setCooked main.l 443
setRaw main.l 417
-sharedLibC_FA main.l 1300
+sharedLibC_FA main.l 1375
shluA_A big.l 201
shruA_A big.l 247
sig main.l 344
@@ -1175,12 +1176,12 @@ tellEndAZ io.l 1012
tellErr err.l 652
tenfoldA_A big.l 157
testEscA_F io.l 2052
-throwErrZX flow.l 2507
-tmDateC_E main.l 2412
-tmTimeY_E main.l 2599
+throwErrZX flow.l 2518
+tmDateC_E main.l 2487
+tmTimeY_E main.l 2674
tokenCE_E io.l 2523
trSyncErrX err.l 608
-traceCY flow.l 3028
+traceCY flow.l 3039
trimE_E subr.l 1769
truncErrX err.l 598
truncLog db.l 947
@@ -1218,10 +1219,10 @@ wrOpenEXY io.l 1497
wrSetCL_F io.l 2746
wrSyncErrX err.l 581
wtermsigS_A sys/x86-64.linux.code.l 28
-xCntAX_FA main.l 2266
-xCntCX_FC main.l 2257
-xCntEX_FE main.l 2248
-xSymE_E main.l 2223
+xCntAX_FA main.l 2341
+xCntCX_FC main.l 2332
+xCntEX_FE main.l 2323
+xSymE_E main.l 2298
xoruAE_A big.l 465
yieldErrEX err.l 488
yieldErrX err.l 486
diff --git a/src64/version.l b/src64/version.l
@@ -1,6 +1,6 @@
-# 06nov12abu
+# 14nov12abu
# (c) Software Lab. Alexander Burger
-(de *Version 3 1 0 12)
+(de *Version 3 1 0 13)
# vi:et:ts=3:sw=3
diff --git a/test/src/main.l b/test/src/main.l
@@ -1,4 +1,4 @@
-# 04nov12abu
+# 14nov12abu
# (c) Software Lab. Alexander Burger
### Evaluation ###
@@ -53,6 +53,14 @@
(env 'X 7 '(A B (C . 3)) 'Y 8) ) )
+### trail ###
+(when trail
+ (let
+ (F '((A B) (G (inc A) (dec B)))
+ G '((X Y) (trail)) )
+ (test '(@X (F 3 4) A 3 B 4 (G (inc A) (dec B)) X 4 Y 3)
+ (F 3 4) ) ) )
+
### up ###
(test 1
(let N 1