aboutsummaryrefslogtreecommitdiff
path: root/lib/DATS/init.dats
blob: a4c84b30910bd12b845b29c5d5ac429ecd0e2e4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
staload "lib/SATS/init.sats"

#define ATS_DYNLOADFLAG 0

implement {vt:viewt@ype} uninitialized (v) =
let
in
  @{initialized = false, obj = v}: initializable vt
end


implement{vt} init_exec (x) = 
  if x.initialized then
    let
      prval () = opt_unsome x.obj
      val () = init_exec$fwork (x.obj)
      prval () = opt_some  x.obj
    in
    end

implement{vt} init_exec$fwork (v) = ()