forked from Orchid/orchid
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:
16
src/systems/stl/tuple.orc
Normal file
16
src/systems/stl/tuple.orc
Normal 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)
|
||||
Reference in New Issue
Block a user