Array concatenation: Difference between revisions
→{{header|ATS}}
Line 655:
length m, with elements of type t, and the array must have been
initialized; the second is a similar array of length n. The third
array is uninitialized (thus the "?"
length m+n; its type will change to "initialized". *)
Line 684:
(* We are done. Everything should now work, and the result will be
safe from buffer overruns or underruns, and against accidental
misuse of uninitialized data. *)
}
fn {t : t@ype}
arrayconcat2 {m, n : nat}
Line 696 ⟶ 697:
m : size_t m,
n : size_t n) : void =
▲(* arrayconcat2 is a pass-by-reference interface to arrayconcat1. Most
▲ val _ = arrayconcat1 (pfa, pfb, pfc | addr@ a, addr@ b, addr@ c,
▲ m, n)
(* Overloads to let you say "arrayconcat" for either routine above. *)
Line 749 ⟶ 735:
<pre>$ patscc -O2 -DATS_MEMALLOC_LIBC arrayconcat.dats && ./a.out
1, 2, 3, 5, 6, 7, 8</pre>
=={{header|AutoHotkey}}==
|