Special accessors for arrays, Text and Blob (tweet)
#4882
ggreif
started this conversation in
Show and tell
Replies: 1 comment
-
|
Scheduled for Friday 6/13 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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()forTextvalues()(orvals()) forBlobAll 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