Added directfs

Added a very rudimentary file I/O system suitable for experimenting
with the language further. A better one will be designed when we have
sensible error management.
This commit is contained in:
2023-09-17 16:37:39 +01:00
parent 1078835e8b
commit 7396078304
84 changed files with 563 additions and 721 deletions

16
src/systems/stl/tuple.orc Normal file
View File

@@ -0,0 +1,16 @@
import super::(known::*, bool::*, num::*)
const discard_args := \n.\value. (
if n == 0 then value
else \_. discard_args (n - 1) value
)
export const pick := \tuple. \i.\n. tuple (
discard_args i \val. discard_args (n - 1 - i) val
)
macro t[...$item, ...$rest:1] =0x2p84=> (\f. t[...$rest] (f (...$item)))
macro t[...$end] =0x1p84=> (\f. f (...$end))
macro t[] =0x1p84=> \f.f
export ::(t)