89 lines
3.4 KiB
Plaintext
89 lines
3.4 KiB
Plaintext
(setglobal Array_spec!
|
|
(let
|
|
(int_a = (makearray[int] 1 2 3)
|
|
float_a = (makearray[float] 1. 2. 3.)
|
|
addr_a = (makearray[addr] "a" "b" "c"))
|
|
(seq (array.length[int] int_a) (array.length[float] float_a)
|
|
(array.length[addr] addr_a)
|
|
(function a (array.length[gen] a))
|
|
(array.get[int] int_a 0) (array.get[float] float_a 0)
|
|
(array.get[addr] addr_a 0)
|
|
(function a (array.get[gen] a 0))
|
|
(array.unsafe_get[int] int_a 0)
|
|
(array.unsafe_get[float] float_a 0)
|
|
(array.unsafe_get[addr] addr_a 0)
|
|
(function a (array.unsafe_get[gen] a 0))
|
|
(array.set[int] int_a 0 1) (array.set[float] float_a 0 1.)
|
|
(array.set[addr] addr_a 0 "a")
|
|
(function a x (array.set[gen] a 0 x))
|
|
(array.unsafe_set[int] int_a 0 1)
|
|
(array.unsafe_set[float] float_a 0 1.)
|
|
(array.unsafe_set[addr] addr_a 0 "a")
|
|
(function a x (array.unsafe_set[gen] a 0 x))
|
|
(let
|
|
(eta_gen_len =
|
|
(function prim (array.length[gen] prim))
|
|
eta_gen_safe_get =
|
|
(function prim prim
|
|
(array.get[gen] prim prim))
|
|
eta_gen_unsafe_get =
|
|
(function prim prim
|
|
(array.unsafe_get[gen] prim prim))
|
|
eta_gen_safe_set =
|
|
(function prim prim prim
|
|
(array.set[gen] prim prim prim))
|
|
eta_gen_unsafe_set =
|
|
(function prim prim prim
|
|
(array.unsafe_set[gen] prim prim prim))
|
|
eta_int_len =
|
|
(function prim (array.length[int] prim))
|
|
eta_int_safe_get =
|
|
(function prim prim
|
|
(array.get[int] prim prim))
|
|
eta_int_unsafe_get =
|
|
(function prim prim
|
|
(array.unsafe_get[int] prim prim))
|
|
eta_int_safe_set =
|
|
(function prim prim prim
|
|
(array.set[int] prim prim prim))
|
|
eta_int_unsafe_set =
|
|
(function prim prim prim
|
|
(array.unsafe_set[int] prim prim prim))
|
|
eta_float_len =
|
|
(function prim (array.length[float] prim))
|
|
eta_float_safe_get =
|
|
(function prim prim
|
|
(array.get[float] prim prim))
|
|
eta_float_unsafe_get =
|
|
(function prim prim
|
|
(array.unsafe_get[float] prim prim))
|
|
eta_float_safe_set =
|
|
(function prim prim prim
|
|
(array.set[float] prim prim prim))
|
|
eta_float_unsafe_set =
|
|
(function prim prim prim
|
|
(array.unsafe_set[float] prim prim prim))
|
|
eta_addr_len =
|
|
(function prim (array.length[addr] prim))
|
|
eta_addr_safe_get =
|
|
(function prim prim
|
|
(array.get[addr] prim prim))
|
|
eta_addr_unsafe_get =
|
|
(function prim prim
|
|
(array.unsafe_get[addr] prim prim))
|
|
eta_addr_safe_set =
|
|
(function prim prim prim
|
|
(array.set[addr] prim prim prim))
|
|
eta_addr_unsafe_set =
|
|
(function prim prim prim
|
|
(array.unsafe_set[addr] prim prim prim)))
|
|
(makeblock 0 int_a float_a addr_a eta_gen_len
|
|
eta_gen_safe_get eta_gen_unsafe_get eta_gen_safe_set
|
|
eta_gen_unsafe_set eta_int_len eta_int_safe_get
|
|
eta_int_unsafe_get eta_int_safe_set
|
|
eta_int_unsafe_set eta_float_len eta_float_safe_get
|
|
eta_float_unsafe_get eta_float_safe_set
|
|
eta_float_unsafe_set eta_addr_len eta_addr_safe_get
|
|
eta_addr_unsafe_get eta_addr_safe_set
|
|
eta_addr_unsafe_set)))))
|