Adding WIP w/ gemini example.

This commit is contained in:
Brad Nelson
2024-11-14 08:13:28 -08:00
parent 3010f6c2b4
commit edab2d382f
4 changed files with 356 additions and 0 deletions

8
examples/gemini/slurp.fs Normal file
View File

@ -0,0 +1,8 @@
: slurp-file ( a n -- a n )
r/o open-file throw >r
r@ file-size throw ( sz )
dup 1+ allocate throw swap ( data sz )
2dup r@ read-file throw drop
r> close-file throw
2dup + 0 swap c!
;