Special accessors for arrays, Text
and Blob
(tweet)
#4882
ggreif
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Certain built-in structured data types can be iterated over their enclosed elements by special accessor functions:
values()
(orvals()
),keys()
for arrays ([T]
and[var T]
)chars()
forText
values()
(orvals()
) forBlob
All these accessors return an iterator (
Iter<T>
) of the element type, so they can be used infor
-expressions. Furthermore all of these structures can be asked there count of elements:s.size() : Nat
, and the arrays' elements can be accessed witha.get(nth)
anda.put(nth, v)
(for mutable ones).Beta Was this translation helpful? Give feedback.
All reactions