diff options
Diffstat (limited to 'jefs.fs')
| -rw-r--r-- | jefs.fs | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 |
