commit 49c8ade18ebc987e12acbe4492f2394a73e5b773
parent 981cd25b7a2034c60d94ac30d5c6d21d9a6debbe
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 12 Jul 2022 09:21:19 -0400
sys/file: use with[] and remove dependency on sys/scratch
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/sys/file.fs b/fs/sys/file.fs
@@ -1,5 +1,6 @@
\ File subsystem
-\ require /sys/scratch.fs \ TODO: use "with" to avoid referencing syspad
+?f<< /lib/scratch.fs
+?f<< /lib/with.fs
\ This subsystems defines a "filesystem" protocol and upon it defines
\ convenience word around files. This subsystem is a bit weird because the
@@ -26,9 +27,8 @@ $200 scratchpad$ filespad
\ This creates a "f<" reader with the file descriptor embedded in it. This
\ allows for a straightforward override of input/output words.
: [f<] ( curfd -- word )
- filespad to Scratchpad
- scratch[ litn compile fgetc exit, ]scratch
- syspad to Scratchpad ;
+ filespad to' Scratchpad with[
+ scratch[ litn compile fgetc exit, ]scratch ]with ;
: .floaded floaded begin dup while dup 4 + stype nl> @ repeat drop ;
: require word dup floaded? not if stype abort" required" else drop then ;