Untitled

Run Settings
LanguageATS
Language Version
Run Command
#include "share/atspre_staload.hats" #include "share/atspre_define.hats" staload UN = "prelude/SATS/unsafe.sats" dataviewtype message = | Bar of (int, double) | Baz of (double, double) vtypedef BAR = Bar_pstruct(int, double) extern vtypedef "BAR" = BAR typedef BAR_ = $extype "BAR_" vtypedef BAZ = Baz_pstruct(double, double) extern vtypedef "BAZ" = BAZ typedef BAZ_ = $extype "BAZ_" extern castfn stack_unwind{a:vt0p}(INV(a)):<> void fn f(x: !message): void = case+ x of | Bar(a,b) => println!("BAR ", a, " ", b) | Baz(a,b) => println!("BAZ ", a, " ", b) implement main0() = let var b : BAR_ val p = $UN.castvwtp0{BAR}(addr@b) val msg = $UN.castvwtp0{message}(addr@b) val Bar(x,y) = p val () = begin x := 5; y := 3.14; f(msg) end val _ = $UN.castvwtp0{ptr}((view@x, view@y | p)) in stack_unwind(msg) end
Editor Settings
Theme
Key bindings
Full width
Lines