summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jefs.fs15
-rw-r--r--jefs.s5
2 files changed, 12 insertions, 8 deletions
diff --git a/jefs.fs b/jefs.fs
index d6ea585..d2064cf 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -14,6 +14,7 @@
: emit ( chr -- ) sp cell+ 1 swap 1 1 syscall3 2drop ;
: cr 10 emit ;
+: octal 8 base ! ;
: decimal 10 base ! ;
: hex 16 base ! ;
@@ -63,7 +64,6 @@ hex : ret, c3 c, ; decimal
: ?comp state @ 0<> if 3 error ! handler execute then ;
: ?intr state @ if 4 error ! handler execute then ;
-\ todo flow ctl wrappers with ?comp
: cells 8 * ;
: allot> here @ swap here +! ;
@@ -79,6 +79,14 @@ hex : ret, c3 c, ; decimal
\ maybe i made bad design decisions, this is CREATE but it pushes a pointer to just after its definition. for arrays and the like
\ does not use LIT because we want to fill it in After
: make create here @ 18 + [compile] lit ret, ;
+\ creates a word called _ (so don't create an actual word called that!!!)
+\ maybe it could be an empty string but that might require some rewriting
+\ (maybe a bad solution, but ; expects a header and reads from LATEST...
+\ maybe WORDS should skip words whose name is just _?)
+\ it may not be a bad idea to redefine ; above this so it works with :noname words.
+\ maybe a NONAMING? variable so we know it's a noname word and thus does not need to be unsmudged?
+\ also we can't use CREATE because it reads from tib. eugh
+: :noname here @ latest @ , 0 c, 1 w, [ char _ ] literal c, latest ! smudge here @ ( ← xt ) [compile] ] ;
\ jonesforth impl
: case 0 ; immediate
@@ -266,6 +274,7 @@ make file-buffer file-buffer-length allot
\ INTERACTIVITY {{{
\ }}}
-file-buffer file-buffer-length stdin read-file drop file-buffer swap evaluate
+.free
+\ file-buffer file-buffer-length stdin read-file drop file-buffer swap evaluate
+:noname 1 2 3 .s ;
bye
-\ .free bye
diff --git a/jefs.s b/jefs.s
index 39ba06e..16a7e1b 100644
--- a/jefs.s
+++ b/jefs.s
@@ -518,11 +518,6 @@ defword ";", semicolon, immediate_mask
mov qword [state], interpreting
ret
-; this is basically an edited copy of :
-; which should probably be rewritten to use this word
-; the differences:
-; this word does not change state
-; smudge mask is not set
defword "create", create, 0
call parse
pspop r9 ; u