summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-02-28 17:57:35 +1100
committerkitty <nepeta@canaglie.net>2026-02-28 17:57:35 +1100
commit4f9d8ac79867481d8682246937fc4df7ac6c75a4 (patch)
treec9af0d40aea3b337217e74d74cd179b2662bb2ce /jefs.fs
parent412c6cc2a7df083d481ce2737547060677761d22 (diff)
octal, :noname
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs15
1 files changed, 12 insertions, 3 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