The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
beb9470
)
Debugging symbol table.
author
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 12 Jul 2016 06:10:07 +0000
(18:10 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 12 Jul 2016 06:10:46 +0000
(18:10 +1200)
scheme.4th
patch
|
blob
|
history
diff --git
a/scheme.4th
b/scheme.4th
index
10e4f26
..
d3555a4
100644
(file)
--- a/
scheme.4th
+++ b/
scheme.4th
@@
-367,30
+367,40
@@
parse-idx-stack parse-idx-sp !
2over 2over
\ Neither nil
2over 2over
\ Neither nil
- car
2swap car rot = -rot = and
if
+ car
drop -rot car drop =
if
cdr 2swap cdr recurse
else
2drop 2drop false
then
;
cdr 2swap cdr recurse
else
2drop 2drop false
then
;
-: (symbol-in-table?) ( charlist symbol-table -- charlist symbol-obj )
+: charlist>symbol ( charlist -- symbol-obj )
+
+ symbol-table fetchobj
begin
nil? false =
while
2over 2over
begin
nil? false =
while
2over 2over
- car
+ car
drop pair-type
charlist-equiv if
charlist-equiv if
+ 2swap 2drop
+ car
+ exit
+ else
+ cdr
+ then
repeat
repeat
-;
-: symbol-in-table? ( charlist -- charlist bool )
- symbol-table (symbol-in-table?) ;
+ 2drop
+ drop symbol-type 2dup
+ symbol-table fetchobj cons
+ symbol-table setobj
+;
defer read
defer read
-: readpair ( -- obj )
+: readpair ( --
pair
obj )
eatspaces
\ Empty lists
eatspaces
\ Empty lists
@@
-467,12
+477,7
@@
defer read
then
symbol? if
then
symbol? if
- readsymbol
- drop symbol-type
- 2dup
- symbol-table fetch
- cons
- symbol-table set
+ readsymbol charlist>symbol
exit
then
exit
then