commit a1db175ea0b87f1d45ced6f3e76b528552970560
parent 142f0d7e275a9e2c1ed537fbba05315be459e590
Author: Alexander Burger <abu@software-lab.de>
Date: Thu, 27 Oct 2011 16:52:42 +0200
'env' should copy symbol-value-pair cells
Diffstat:
M | lib/tags | | | 44 | ++++++++++++++++++++++---------------------- |
M | src/main.c | | | 6 | ++++-- |
M | src64/main.l | | | 17 | ++++++++++------- |
M | src64/tags | | | 154 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
4 files changed, 113 insertions(+), 108 deletions(-)
diff --git a/lib/tags b/lib/tags
@@ -32,9 +32,9 @@ and (1616 . "@src64/flow.l")
any (3965 . "@src64/io.l")
append (1338 . "@src64/subr.l")
apply (713 . "@src64/apply.l")
-arg (2310 . "@src64/main.l")
-args (2286 . "@src64/main.l")
-argv (2930 . "@src64/main.l")
+arg (2313 . "@src64/main.l")
+args (2289 . "@src64/main.l")
+argv (2933 . "@src64/main.l")
as (139 . "@src64/flow.l")
asoq (3005 . "@src64/subr.l")
assoc (2970 . "@src64/subr.l")
@@ -65,7 +65,7 @@ call (3082 . "@src64/flow.l")
car (5 . "@src64/subr.l")
case (1957 . "@src64/flow.l")
catch (2459 . "@src64/flow.l")
-cd (2685 . "@src64/main.l")
+cd (2688 . "@src64/main.l")
cdaaar (464 . "@src64/subr.l")
cdaadr (487 . "@src64/subr.l")
cdaar (179 . "@src64/subr.l")
@@ -88,7 +88,7 @@ circ (816 . "@src64/subr.l")
circ? (2402 . "@src64/subr.l")
clip (1799 . "@src64/subr.l")
close (4381 . "@src64/io.l")
-cmd (2912 . "@src64/main.l")
+cmd (2915 . "@src64/main.l")
cnt (1413 . "@src64/apply.l")
co (2540 . "@src64/flow.l")
commit (1495 . "@src64/db.l")
@@ -99,9 +99,9 @@ connect (224 . "@src64/net.l")
cons (747 . "@src64/subr.l")
copy (1225 . "@src64/subr.l")
ctl (4254 . "@src64/io.l")
-ctty (2710 . "@src64/main.l")
+ctty (2713 . "@src64/main.l")
cut (1911 . "@src64/sym.l")
-date (2424 . "@src64/main.l")
+date (2427 . "@src64/main.l")
dbck (2104 . "@src64/db.l")
de (529 . "@src64/flow.l")
dec (2323 . "@src64/big.l")
@@ -111,7 +111,7 @@ del (1966 . "@src64/sym.l")
delete (1401 . "@src64/subr.l")
delq (1452 . "@src64/subr.l")
diff (2589 . "@src64/subr.l")
-dir (2843 . "@src64/main.l")
+dir (2846 . "@src64/main.l")
dm (542 . "@src64/flow.l")
do (2133 . "@src64/flow.l")
e (2914 . "@src64/flow.l")
@@ -120,7 +120,7 @@ env (606 . "@src64/main.l")
eof (3524 . "@src64/io.l")
eol (3515 . "@src64/io.l")
err (4234 . "@src64/io.l")
-errno (1374 . "@src64/main.l")
+errno (1377 . "@src64/main.l")
eval (175 . "@src64/flow.l")
ext (5146 . "@src64/io.l")
ext? (1149 . "@src64/sym.l")
@@ -128,7 +128,7 @@ extern (1015 . "@src64/sym.l")
extra (1261 . "@src64/flow.l")
extract (1218 . "@src64/apply.l")
fifo (2077 . "@src64/sym.l")
-file (2790 . "@src64/main.l")
+file (2793 . "@src64/main.l")
fill (3240 . "@src64/subr.l")
filter (1161 . "@src64/apply.l")
fin (2033 . "@src64/subr.l")
@@ -166,7 +166,7 @@ ifn (1857 . "@src64/flow.l")
in (4194 . "@src64/io.l")
inc (2256 . "@src64/big.l")
index (2637 . "@src64/subr.l")
-info (2747 . "@src64/main.l")
+info (2750 . "@src64/main.l")
intern (990 . "@src64/sym.l")
ipid (3201 . "@src64/flow.l")
isa (958 . "@src64/flow.l")
@@ -183,7 +183,7 @@ lieu (1154 . "@src64/db.l")
line (3699 . "@src64/io.l")
lines (3852 . "@src64/io.l")
link (1172 . "@src64/subr.l")
-lisp (1982 . "@src64/main.l")
+lisp (1985 . "@src64/main.l")
list (887 . "@src64/subr.l")
listen (157 . "@src64/net.l")
lit (150 . "@src64/flow.l")
@@ -222,10 +222,10 @@ n== (2087 . "@src64/subr.l")
nT (2198 . "@src64/subr.l")
name (502 . "@src64/sym.l")
nand (1651 . "@src64/flow.l")
-native (1382 . "@src64/main.l")
+native (1385 . "@src64/main.l")
need (919 . "@src64/subr.l")
new (832 . "@src64/flow.l")
-next (2293 . "@src64/main.l")
+next (2296 . "@src64/main.l")
nil (1734 . "@src64/flow.l")
nond (1934 . "@src64/flow.l")
nor (1672 . "@src64/flow.l")
@@ -239,7 +239,7 @@ onOff (1727 . "@src64/sym.l")
one (1760 . "@src64/sym.l")
open (4338 . "@src64/io.l")
opid (3217 . "@src64/flow.l")
-opt (3033 . "@src64/main.l")
+opt (3036 . "@src64/main.l")
or (1632 . "@src64/flow.l")
out (4214 . "@src64/io.l")
pack (1259 . "@src64/sym.l")
@@ -272,9 +272,9 @@ push (1802 . "@src64/sym.l")
push1 (1838 . "@src64/sym.l")
put (2824 . "@src64/sym.l")
putl (3096 . "@src64/sym.l")
-pwd (2674 . "@src64/main.l")
+pwd (2677 . "@src64/main.l")
queue (2034 . "@src64/sym.l")
-quit (1089 . "@src64/main.l")
+quit (1092 . "@src64/main.l")
quote (134 . "@src64/flow.l")
rand (3003 . "@src64/big.l")
range (997 . "@src64/subr.l")
@@ -283,7 +283,7 @@ raw (449 . "@src64/main.l")
rd (5163 . "@src64/io.l")
read (2656 . "@src64/io.l")
replace (1499 . "@src64/subr.l")
-rest (2339 . "@src64/main.l")
+rest (2342 . "@src64/main.l")
reverse (1678 . "@src64/subr.l")
rewind (5129 . "@src64/io.l")
rollback (1889 . "@src64/db.l")
@@ -324,7 +324,7 @@ text (1387 . "@src64/sym.l")
throw (2485 . "@src64/flow.l")
tick (3169 . "@src64/flow.l")
till (3610 . "@src64/io.l")
-time (2557 . "@src64/main.l")
+time (2560 . "@src64/main.l")
touch (1164 . "@src64/sym.l")
trim (1759 . "@src64/subr.l")
try (1171 . "@src64/flow.l")
@@ -333,13 +333,13 @@ udp (301 . "@src64/net.l")
unify (3935 . "@src64/subr.l")
unless (1893 . "@src64/flow.l")
until (2077 . "@src64/flow.l")
-up (697 . "@src64/main.l")
+up (700 . "@src64/main.l")
upp? (3376 . "@src64/sym.l")
uppc (3440 . "@src64/sym.l")
use (1565 . "@src64/flow.l")
-usec (2662 . "@src64/main.l")
+usec (2665 . "@src64/main.l")
val (1577 . "@src64/sym.l")
-version (3047 . "@src64/main.l")
+version (3050 . "@src64/main.l")
wait (3150 . "@src64/io.l")
when (1876 . "@src64/flow.l")
while (2053 . "@src64/flow.l")
diff --git a/src/main.c b/src/main.c
@@ -1,4 +1,4 @@
-/* 11oct11abu
+/* 27oct11abu
* (c) Software Lab. Alexander Burger
*/
@@ -302,7 +302,9 @@ any doEnv(any x) {
if (isCell(data(c2))) {
do
data(c1) = cons(
- isCell(car(data(c2)))? car(data(c2)) : cons(car(data(c2)), val(car(data(c2)))),
+ isCell(car(data(c2)))?
+ cons(caar(data(c2)), cdar(data(c2))) :
+ cons(car(data(c2)), val(car(data(c2)))),
data(c1) );
while (isCell(data(c2) = cdr(data(c2))));
}
diff --git a/src64/main.l b/src64/main.l
@@ -1,4 +1,4 @@
-# 20oct11abu
+# 27oct11abu
# (c) Software Lab. Alexander Burger
(code 'Code)
@@ -655,12 +655,15 @@
atom E # 'lst'?
if z # Yes
do
- ld A (E) # Already a pair?
- atom A
- if nz # No
- call cons_A # Cons symbol and its value
- ld (A) (E)
- ld (A CDR) ((E))
+ call cons_A # Prepare new cell
+ ld C (E) # Next item already a pair?
+ atom C
+ if z # Yes
+ ld (A) (C) # Copy it
+ ld (A CDR) (C CDR)
+ else
+ ld (A) C # Cons symbol and its value
+ ld (A CDR) (C)
end
call consA_C # Cons to result
ld (C) A
diff --git a/src64/tags b/src64/tags
@@ -425,12 +425,12 @@ badFdErrEX ./err.l 525
badInputErrB ./err.l 545
balanceCEY ./sym.l 902
balanceXY ./sym.l 884
-begString ./main.l 2248
+begString ./main.l 2251
binPrintEZ ./io.l 730
binReadZ_FE ./io.l 519
blkPeekCEZ ./db.l 392
blkPokeCEZ ./db.l 403
-boxE_E ./main.l 2216
+boxE_E ./main.l 2219
boxNumA_A ./gc.l 872
boxNumE_E ./gc.l 886
boxNum_A ./gc.l 824
@@ -446,31 +446,31 @@ byteNumBCX_CX ./io.l 463
byteSymBCX_CX ./io.l 1291
caseDataA_AC ./sym.l 3349
caught ./flow.l 2475
-cbl ./main.l 1851
-cbl1 ./main.l 1884
-cbl10 ./main.l 1920
-cbl11 ./main.l 1924
-cbl12 ./main.l 1928
-cbl13 ./main.l 1932
-cbl14 ./main.l 1936
-cbl15 ./main.l 1940
-cbl16 ./main.l 1944
-cbl17 ./main.l 1948
-cbl18 ./main.l 1952
-cbl19 ./main.l 1956
-cbl2 ./main.l 1888
-cbl20 ./main.l 1960
-cbl21 ./main.l 1964
-cbl22 ./main.l 1968
-cbl23 ./main.l 1972
-cbl24 ./main.l 1976
-cbl3 ./main.l 1892
-cbl4 ./main.l 1896
-cbl5 ./main.l 1900
-cbl6 ./main.l 1904
-cbl7 ./main.l 1908
-cbl8 ./main.l 1912
-cbl9 ./main.l 1916
+cbl ./main.l 1854
+cbl1 ./main.l 1887
+cbl10 ./main.l 1923
+cbl11 ./main.l 1927
+cbl12 ./main.l 1931
+cbl13 ./main.l 1935
+cbl14 ./main.l 1939
+cbl15 ./main.l 1943
+cbl16 ./main.l 1947
+cbl17 ./main.l 1951
+cbl18 ./main.l 1955
+cbl19 ./main.l 1959
+cbl2 ./main.l 1891
+cbl20 ./main.l 1963
+cbl21 ./main.l 1967
+cbl22 ./main.l 1971
+cbl23 ./main.l 1975
+cbl24 ./main.l 1979
+cbl3 ./main.l 1895
+cbl4 ./main.l 1899
+cbl5 ./main.l 1903
+cbl6 ./main.l 1907
+cbl7 ./main.l 1911
+cbl8 ./main.l 1915
+cbl9 ./main.l 1919
cellErrAX ./err.l 438
cellErrEX ./err.l 440
charSymACX_CX ./io.l 1256
@@ -478,7 +478,7 @@ checkVarAX ./err.l 365
checkVarEX ./err.l 381
checkVarYX ./err.l 373
chopExtNmX_E ./db.l 133
-circE_YF ./main.l 744
+circE_YF ./main.l 747
cleanUpY ./db.l 567
closeAX ./io.l 5
closeErrEX ./err.l 506
@@ -495,7 +495,7 @@ cmpuAE_F ./big.l 1587
cntErrAX ./err.l 418
cntErrCX ./err.l 420
cntErrEX ./err.l 422
-compareAE_F ./main.l 909
+compareAE_F ./main.l 912
consAC_E ./gc.l 786
consA_A ./gc.l 530
consA_C ./gc.l 594
@@ -534,7 +534,7 @@ ctOpenEXY ./io.l 1670
currFdX_C ./io.l 1333
currFd_C ./io.l 1337
cutLocalCX ./flow.l 2827
-dateXYZ_E ./main.l 2363
+dateXYZ_E ./main.l 2366
dbAEX ./db.l 1328
dbFetchEX ./db.l 1316
dbFileBlkY_AC ./db.l 246
@@ -564,9 +564,9 @@ doAnd ./flow.l 1616
doAny ./io.l 3965
doAppend ./subr.l 1338
doApply ./apply.l 713
-doArg ./main.l 2310
-doArgs ./main.l 2286
-doArgv ./main.l 2930
+doArg ./main.l 2313
+doArgs ./main.l 2289
+doArgv ./main.l 2933
doArrow ./subr.l 3913
doAs ./flow.l 139
doAsoq ./subr.l 3005
@@ -602,7 +602,7 @@ doCall ./flow.l 3082
doCar ./subr.l 5
doCase ./flow.l 1957
doCatch ./flow.l 2459
-doCd ./main.l 2685
+doCd ./main.l 2688
doCdaaar ./subr.l 464
doCdaadr ./subr.l 487
doCdaar ./subr.l 179
@@ -625,7 +625,7 @@ doCirc ./subr.l 816
doCircQ ./subr.l 2402
doClip ./subr.l 1799
doClose ./io.l 4381
-doCmd ./main.l 2912
+doCmd ./main.l 2915
doCnt ./apply.l 1413
doCo ./flow.l 2540
doCol ./sym.l 3034
@@ -637,9 +637,9 @@ doConnect ./net.l 224
doCons ./subr.l 747
doCopy ./subr.l 1225
doCtl ./io.l 4254
-doCtty ./main.l 2710
+doCtty ./main.l 2713
doCut ./sym.l 1911
-doDate ./main.l 2424
+doDate ./main.l 2427
doDbck ./db.l 2104
doDe ./flow.l 529
doDec ./big.l 2323
@@ -649,7 +649,7 @@ doDel ./sym.l 1966
doDelete ./subr.l 1401
doDelq ./subr.l 1452
doDiff ./subr.l 2589
-doDir ./main.l 2843
+doDir ./main.l 2846
doDiv ./big.l 2513
doDm ./flow.l 542
doDo ./flow.l 2133
@@ -663,7 +663,7 @@ doEq0 ./subr.l 2173
doEqT ./subr.l 2181
doEqual ./subr.l 2115
doErr ./io.l 4234
-doErrno ./main.l 1374
+doErrno ./main.l 1377
doEval ./flow.l 175
doExt ./io.l 5146
doExtQ ./sym.l 1149
@@ -671,7 +671,7 @@ doExtern ./sym.l 1015
doExtra ./flow.l 1261
doExtract ./apply.l 1218
doFifo ./sym.l 2077
-doFile ./main.l 2790
+doFile ./main.l 2793
doFill ./subr.l 3240
doFilter ./apply.l 1161
doFin ./subr.l 2033
@@ -712,7 +712,7 @@ doIfn ./flow.l 1857
doIn ./io.l 4194
doInc ./big.l 2256
doIndex ./subr.l 2637
-doInfo ./main.l 2747
+doInfo ./main.l 2750
doIntern ./sym.l 990
doIpid ./flow.l 3201
doIsa ./flow.l 958
@@ -730,7 +730,7 @@ doLieu ./db.l 1154
doLine ./io.l 3699
doLines ./io.l 3852
doLink ./subr.l 1172
-doLisp ./main.l 1982
+doLisp ./main.l 1985
doList ./subr.l 887
doListen ./net.l 157
doLit ./flow.l 150
@@ -773,10 +773,10 @@ doNEqT ./subr.l 2198
doNEqual ./subr.l 2144
doName ./sym.l 502
doNand ./flow.l 1651
-doNative ./main.l 1382
+doNative ./main.l 1385
doNeed ./subr.l 919
doNew ./flow.l 832
-doNext ./main.l 2293
+doNext ./main.l 2296
doNil ./flow.l 1734
doNond ./flow.l 1934
doNor ./flow.l 1672
@@ -790,7 +790,7 @@ doOnOff ./sym.l 1727
doOne ./sym.l 1760
doOpen ./io.l 4338
doOpid ./flow.l 3217
-doOpt ./main.l 3033
+doOpt ./main.l 3036
doOr ./flow.l 1632
doOut ./io.l 4214
doPack ./sym.l 1259
@@ -824,9 +824,9 @@ doPush ./sym.l 1802
doPush1 ./sym.l 1838
doPut ./sym.l 2824
doPutl ./sym.l 3096
-doPwd ./main.l 2674
+doPwd ./main.l 2677
doQueue ./sym.l 2034
-doQuit ./main.l 1089
+doQuit ./main.l 1092
doQuote ./flow.l 134
doRand ./big.l 3003
doRange ./subr.l 997
@@ -836,7 +836,7 @@ doRd ./io.l 5163
doRead ./io.l 2656
doRem ./big.l 2572
doReplace ./subr.l 1499
-doRest ./main.l 2339
+doRest ./main.l 2342
doReverse ./subr.l 1678
doRewind ./io.l 5129
doRollback ./db.l 1889
@@ -881,7 +881,7 @@ doText ./sym.l 1387
doThrow ./flow.l 2485
doTick ./flow.l 3169
doTill ./io.l 3610
-doTime ./main.l 2557
+doTime ./main.l 2560
doTouch ./sym.l 1164
doTrace ./flow.l 2953
doTrim ./subr.l 1759
@@ -891,13 +891,13 @@ doUdp ./net.l 301
doUnify ./subr.l 3935
doUnless ./flow.l 1893
doUntil ./flow.l 2077
-doUp ./main.l 697
+doUp ./main.l 700
doUppQ ./sym.l 3376
doUppc ./sym.l 3440
doUse ./flow.l 1565
-doUsec ./main.l 2662
+doUsec ./main.l 2665
doVal ./sym.l 1577
-doVersion ./main.l 3047
+doVersion ./main.l 3050
doWait ./io.l 3150
doWhen ./flow.l 1876
doWhile ./flow.l 2053
@@ -910,24 +910,24 @@ doYield ./flow.l 2709
doYoke ./subr.l 1196
doZap ./sym.l 1178
doZero ./sym.l 1745
-endString_E ./main.l 2259
+endString_E ./main.l 2262
eofErr ./err.l 534
eolA_F ./io.l 3684
-equalAE_F ./main.l 776
+equalAE_F ./main.l 779
erOpenEXY ./io.l 1628
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 2187
-evCntXY_FE ./main.l 2185
-evExprCE_E ./main.l 1107
-evListE_E ./main.l 1251
+evCntEX_FE ./main.l 2190
+evCntXY_FE ./main.l 2188
+evExprCE_E ./main.l 1110
+evListE_E ./main.l 1254
evMethodACXYZ_E ./flow.l 642
-evSymE_E ./main.l 2162
-evSymX_E ./main.l 2157
-evSymY_E ./main.l 2160
-execE ./main.l 2071
+evSymE_E ./main.l 2165
+evSymX_E ./main.l 2160
+evSymY_E ./main.l 2163
+execE ./main.l 2074
execErrS ./main.l 187
extErrEX ./err.l 434
extNmCE_X ./db.l 64
@@ -937,7 +937,7 @@ fdRdSetCZL ./io.l 2718
fdSetCL_X ./io.l 2706
fdSetC_Y ./io.l 3309
fdWrSetCZL ./io.l 2725
-fetchCharC_AC ./main.l 1816
+fetchCharC_AC ./main.l 1819
fileObjE_AC ./db.l 237
fileObjX_AC ./db.l 211
fillE_FE ./subr.l 3258
@@ -955,7 +955,7 @@ fmtWordACX_CX ./big.l 2046
forkErrX ./err.l 515
forkLispX_FE ./flow.l 3269
fsyncDB ./db.l 929
-funqE_FE ./main.l 2095
+funqE_FE ./main.l 2098
gc ./gc.l 65
getAdrZ_A ./db.l 6
getBinaryZ_FB ./io.l 447
@@ -997,7 +997,7 @@ isaCE_F ./flow.l 1009
jnlErrX ./err.l 618
jnlFileno_A ./db.l 344
joinLocalCX ./flow.l 2840
-lisp ./main.l 2025
+lisp ./main.l 2028
loadAllX_E ./main.l 162
loadBEX_E ./io.l 4072
lockErr ./err.l 607
@@ -1015,13 +1015,13 @@ main ./main.l 33
makeErrX ./err.l 471
markE ./gc.l 5
matchCE_F ./subr.l 3144
-memberXY_FY ./main.l 1071
+memberXY_FY ./main.l 1074
metaCX_E ./sym.l 3323
methodEY_FCYZ ./flow.l 788
mkCharA_A ./sym.l 573
mkStrEZ_A ./sym.l 650
mkStrE_E ./sym.l 623
-msec_A ./main.l 2273
+msec_A ./main.l 2276
msgErrAX ./err.l 488
msgErrEX ./err.l 490
msgErrYX ./err.l 486
@@ -1030,7 +1030,7 @@ nameA_A ./sym.l 469
nameE_E ./sym.l 477
nameX_X ./sym.l 485
nameY_Y ./sym.l 493
-natRetACE_CE ./main.l 1668
+natRetACE_CE ./main.l 1671
needC ./gc.l 54
needSymAX ./err.l 323
needSymEX ./err.l 335
@@ -1086,7 +1086,7 @@ putACE ./sym.l 2480
putBlockBZ ./db.l 609
putSrcEC_E ./flow.l 25
putStdoutB ./io.l 4625
-putStringB ./main.l 2236
+putStringB ./main.l 2239
putTellBZ ./io.l 996
putUdpBZ ./net.l 377
rdAtomBY_E ./io.l 2117
@@ -1123,7 +1123,7 @@ retnc ./err.l 710
retnz ./err.l 716
retz ./err.l 713
rewindLog ./db.l 925
-runE_E ./main.l 2083
+runE_E ./main.l 2086
rwUnlockDbA ./db.l 269
s_isdirS_F sys/x86-64.linux.code.l 16
selectErrX ./err.l 558
@@ -1134,7 +1134,7 @@ setBlkAC_Z ./db.l 366
setBlockAC_Z ./db.l 364
setCooked ./main.l 441
setRaw ./main.l 415
-sharedLibC_FA ./main.l 1304
+sharedLibC_FA ./main.l 1307
shluA_A ./big.l 201
shruA_A ./big.l 247
sig ./main.l 342
@@ -1173,8 +1173,8 @@ tellErr ./err.l 646
tenfoldA_A ./big.l 157
testEscA_F ./io.l 2050
throwErrZX ./flow.l 2510
-tmDateC_E ./main.l 2353
-tmTimeY_E ./main.l 2540
+tmDateC_E ./main.l 2356
+tmTimeY_E ./main.l 2543
tokenCE_E ./io.l 2522
trSyncErrX ./err.l 602
traceCY ./flow.l 3025
@@ -1215,10 +1215,10 @@ wrOpenEXY ./io.l 1495
wrSetCL_F ./io.l 2737
wrSyncErrX ./err.l 575
wtermsigS_A sys/x86-64.linux.code.l 34
-xCntAX_FA ./main.l 2207
-xCntCX_FC ./main.l 2198
-xCntEX_FE ./main.l 2189
-xSymE_E ./main.l 2164
+xCntAX_FA ./main.l 2210
+xCntCX_FC ./main.l 2201
+xCntEX_FE ./main.l 2192
+xSymE_E ./main.l 2167
xoruAE_A ./big.l 465
yieldErrEX ./err.l 482
yieldErrX ./err.l 480