rudus/assets/test_prelude.ld

18 lines
415 B
Plaintext
Raw Permalink Normal View History

& base :print! ("Hello from Prelude")
& I can't figure out why I need this, but I do
& Otherwise the validator won't close over `base`
let base = base
fn add (x as :number, y as :number) -> base :add (x, y)
fn dec (n as :number) -> base :sub (n, 1)
fn sub (x as :number, y as :number) -> base :sub (x, y)
2024-12-13 00:43:56 +00:00
fn panics! () -> add ("foo", "bar")
2024-12-13 00:28:55 +00:00
fn print!(x) -> base :print! (x)
2024-12-13 00:01:51 +00:00
2024-12-13 00:43:56 +00:00
#{add, dec, sub, print!, panics!}