arrays' set_at/get_at functions and viewtypes

18 views
Skip to first unread message

Dambaev Alexander

unread,
Aug 1, 2020, 11:01:56 AM8/1/20
to ats-lan...@googlegroups.com
Hi,

array and arrayptr have constraint {a:vt0p} for most of functions, except array_set_at / arrayptr_set_at/array_get_at/arrayptr_get_at, which have constraint {a:t0ype}

So we can enumerate elements as viewtypes with foreach family of functions, but the only way to set/get them is to use ptr_set/ptr_get, right?

Is it expected?

gmhwxi

unread,
Aug 1, 2020, 1:10:38 PM8/1/20
to ats-lang-users

You can also use array_v_split and array_v_unsplit to safely get/set linear
elements in an array.
Reply all
Reply to author
Forward
0 new messages