externfun arr_exmpl2{n:nat}(A1 : !arrayptr (int,n),A : !arrayptr (int?,n) >> arrayptr (int,n) , n: int(n) ): void
implement arr_exmpl2(A1,A,n) = let
implementarray_initize$init<int> (i,x) = let val (fpf | A1) = decode($vcopyenv_vt (A1)) val () = x := g0u2i(i) + arrayptr_get_at_gint<int>(A1,i) (* why does not i or sz2i(i) works above *)(* what is g0u2i and why sz2i(i) does not work here ?? *)
val () = fpf (A1) in () end
val () = arrayptr_initize<int>(A,i2sz(n))
in () end
val idx = g1ofg0_int(g0uint2int(i))
... arrayptr_get_at_gint<int>(A1,idx)
staload "share/atspre_staload.hats"
extern
fun arr_exmpl2{n:nat}
(A1 : !arrayptr (int,n),
A : !arrayptr (int?,n) >> arrayptr (int,n) , n: int(n) ): void
implement
arr_exmpl2{n}(A1,A,n) = let
implement
array_initize$init<int> (i,x) = let
val i = $UNSAFE.cast{sizeLt(n)}(i)
val (fpf | A1) = decode($vcopyenv_vt (A1))
val () = x := A1[i] + sz2i(i)
(* why does not i or sz2i(i) works above *)
(* what is g0u2i and why sz2i(i) does not work here ?? *)
val () = fpf (A1)
in () end
val () = arrayptr_initize<int>(A,i2sz(n))
in () end
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/de4be7ba-711c-4bf7-9637-55854a95a2e2%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.