diff options
| author | kitty <nepeta@canaglie.net> | 2026-03-08 19:56:32 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-03-08 19:56:32 +1100 |
| commit | 2bf0d651a66c94139b320487398010277d1a510a (patch) | |
| tree | 0874649f14ae187a6b8f22c8c874867b515f9642 | |
| parent | c4745240f68839843909b6a4d8624f15f58fa7c1 (diff) | |
jonesforth depth
| -rw-r--r-- | jefs.fs | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,6 +1,7 @@ \ i think something is going on with the stack. i dunno : cell+ 8 + ; +: cell- 8 - ; : say ( c-addr u -- ) swap 1 1 syscall3 drop ; : emit ( chr -- ) sp cell+ 1 swap 1 1 syscall3 2drop ; : cr 10 emit ; @@ -266,6 +267,8 @@ make error-msgs #error-msgs cells allot : (words) ( lfa -- ) dup hidden? not if >nfa dup w@ swap 2 + swap say 2 spaces else drop then ; : words latest @ begin ?dup 0<> while dup (words) @ repeat cr ; +: depth ( -- n ) s0 @ sp @ - 16 - ; + \ I/O {{{ 0 constant stdin 1 constant stdout |
