Collection interfaces, comparison helpers, iteration utilities, and view slicing helpers.
Index: random-access protocol with at and size.Iter: forward iteration protocol with next and optional size.Iterable: protocol with iter that produces an Iter.ReverseIterable: protocol with reverseIter that produces reverse iteration.View: known-size view protocol with mandatory iter, size, and slice, and optional at and index.isDirtyOrDynamic, isIndex, isIter, isView, and schemaNameBeginsWith: protocol and shape predicates.toIndex, toIter, and toView: convert supported built-in or protocol-based sources to the corresponding interface object.makeArrayIndex, makeArrayIter, and makeArrayView: adapters for contiguous storage.toTextIter and toTextView: adapters for built-in text as UTF-8 code units.makeTupleIndex, makeTupleIter, and makeTupleView: adapters for built-in tuples by zero-based ordinal.makeObjectIter, objectFields, objectKeys, and objectValues: object traversal helpers.toIter accepts built-in text, built-in tuples, direct Iter values, and objects that expose iter.toIndex accepts built-in tuples, direct Index values, and objects that expose index.toView accepts built-in text, built-in tuples, and direct View values.toIndex, toIter, and toView apply these built-in rules before falling back to protocol-based objects.<, =, and >: prefer less, equal, and greater methods when present; otherwise compare supported iteration sources lexicographically.beginsWith (source prefix -- valid): reports whether source starts with prefix.contains (source pattern -- valid): reports whether pattern appears as a contiguous subsequence of source.endsWith (source suffix -- valid): reports whether source ends with suffix.find (source pattern -- ordinal): returns the first matching ordinal.findOneOf (source patterns -- sourceOrdinal patternOrdinal): returns the first matching source ordinal together with the matching pattern ordinal.findOrdinal (source predicate -- ordinal) and findOrdinalStatic: return the first ordinal for which the predicate reports TRUE.case, cond, and cond0: descriptor-driven branching combinators.meetsAll and meetsAny: apply many predicate blocks to one object.find returns the source size when the pattern is absent.findOneOf returns the source size and -1 when no pattern matches.findOrdinal and findOrdinalStatic return -1 when no predicate match exists.beginsWith, contains, and endsWith return only TRUE or FALSE.fibonacci and iota: generated iteration sources.countIter, enumerate, filter, headIter, joinIter, map, and wrapIter: iteration adapters and transformers.unhead on an Iter: consumes a fixed number of leading items and returns the remaining iteration source.all, allStatic, any, anyStatic, and count: iteration consumers that compute aggregate results.each, eachStatic, and interleave: iteration consumers with side effects.mutate: transforms each item of one mutable iteration source in place.slice (view offset size -- result): returns a subview with the requested offset and size.range (view offset0 offset1 -- result): returns a subview from offset0 up to offset1.head (view size -- result): returns the leading subview of size size.tail (view size -- result): returns the trailing subview of size size.unhead (view size -- result): removes a leading prefix of size size.untail (view size -- result): removes a trailing suffix of size size.All slicing helpers require bounds that stay within the current view.
"algorithm" use
"control" use
{} () {} [
(10 20 30 40) count printStack _:;
(10 20 30 40) (20 30) contains printStack _:;
(10 20 30 40) [30 =] findOrdinal printStack _:;
] "main" exportFunction
4
TRUE
2
"algorithm" use
"control" use
{} () {} [
view: "hello" toView;
view.size printStack _:;
1 3 @view.slice.size printStack _:;
] "main" exportFunction
5
3
"algorithm" use
"String" use
"control" use
{} Int32 {} [
("count=" (10 20 30 40) count LF
"contains=" (10 20 30 40) (20 30) contains LF
"find=" (10 20 30 40) [30 =] findOrdinal LF) printList
0
] "main" exportFunction
count=4
contains=TRUE
find=2