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 (from parent 1:
d97ced4
)
Started adding support for pre-defined symbols.
author
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 12 Jul 2016 12:05:46 +0000
(
00:05
+1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 12 Jul 2016 12:05:46 +0000
(
00:05
+1200)
scheme.4th
patch
|
blob
|
history
diff --git
a/scheme.4th
b/scheme.4th
index
5ea44ee
..
120edd2
100644
(file)
--- a/
scheme.4th
+++ b/
scheme.4th
@@
-18,7
+18,7
@@
include defer-is.4th
\ ------ Memory ------
\ ------ Memory ------
-100 constant N
+100
0
constant N
create car-cells N allot
create car-type-cells N allot
create cdr-cells N allot
create car-cells N allot
create car-type-cells N allot
create cdr-cells N allot
@@
-65,6
+65,33
@@
variable nextfree
objvar symbol-table
nil symbol-table setobj
objvar symbol-table
nil symbol-table setobj
+\ ---- Pre-defined symbols ----
+
+: (create-symbol) ( addr n -- symbol-obj )
+ dup 0= if
+ 2drop nil
+ else
+ 2dup drop @ character-type 2swap
+ swap 1+ swap 1-
+ recurse
+
+ cons
+ then
+;
+
+: create-symbol ( -- )
+ bl word
+ count
+ (create-symbol)
+ drop symbol-type
+
+ symbol-table fetchobj
+ cons
+ symbol-table setobj
+;
+
+create-symbol quote
+
\ ---- Read ----
variable parse-idx
\ ---- Read ----
variable parse-idx