Simplify terminate + bye + fix build.

This commit is contained in:
Brad Nelson
2022-12-31 21:02:04 -08:00
parent d60606b4c8
commit 1c500c2233
11 changed files with 14 additions and 27 deletions

View File

@ -13,12 +13,12 @@
\ limitations under the License.
( Include first argument if any )
posix also internals definitions
internals definitions
: autoexec
( Open passed file if any. )
argc 2 >= if 1 argv ['] included catch if 1 sysexit then exit then
argc 2 >= if 1 argv ['] included catch if 1 terminate then exit then
( Open remembered file if any. )
['] revive catch drop
;
' autoexec ( leave on dstack for fini.fs )
only forth definitions
forth definitions

View File

@ -105,7 +105,6 @@ decimal
( Hookup I/O )
: stdout-write ( a n -- ) stdout -rot write drop ;
: stdin-key ( -- n ) 0 >r stdin rp@ 1 read drop r> ;
: posix-bye 0 sysexit ;
also forth definitions
: default-type stdout-write ;
@ -113,7 +112,7 @@ also forth definitions
only posix definitions
' default-type is type
' default-key is key
' posix-bye is bye
' sysexit is terminate
( I/O Error Helpers )
: 0<ior ( n -- ior ) 0< if errno else 0 then ;