Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean
Examples: 173 come from the library's tests; 464 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzList([ 5, 3, 8, 3, 1 ]). 250 methods have none yet. Examples run on 2026-10-03 20:34 inside the library at commit 0e72e2e2c.
Method
Explanation, as the source carries it
init
Build the list object from the given Haro list.no extension
DeepList
Deep (nested) list view: promotes to stzDeepList for the path-based deep API (DeepFind / Paths / ItemAtPath / ...). Kept modular -- the deep operations live in the stzDeepList subclass, not here.also written: AsDeepListno extension
getting the content of the list
16 examples run? @@( Q(["A", "B" ]) * 3 )
? @@( ( Q(["A", "B" ]) * Q(3) ).Content() )
#--> [ "A", "B", "A", "B", "A", "B" ]
#--> [ "A", "B", "A", "B", "A", "B" ]
library testQCSXTZZZIBWUCopy
getting a copy of the listno extension
ReversedCopy
Same as ReverseQ: Same as Reverse: Reverse the order of the items in place (mutating). For a copy, use Reversed.no extension
NumberOfItemsCSB
(no comment in the source: the name reads as a sentence) number of items csbin the section getting the number of items of the listcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfItemsCSB(TRUE)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU HowMany: number of items (alias of NumberOfItems).
5 examples runalso written: HowManyItemsin the section getting the number of items of the listo1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
library testQCSXTZZZIBWUWFNumberOfItemsB
(no comment in the source: the name reads as a sentence) number of items bin the section getting the number of items of the listcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfItemsB()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU getting the list of items
9 examples runcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Items() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUWFExceptgetting the nth item in the list
2 examples runalso written: ItemAt · NthItem · ItemAtPositioncomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Item(2)
#--> 3
composed from the signature, run for this page QCSXTZZZIBWUWFFirstItem
getting the first item in the list
also named: head front first element the top beginning itemcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FirstItem()
#--> 5
composed from the signature, run for this page QCSXTZZZIBWUWFLastItem
getting the last item in the list
also named: tail back last element the end final itemcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.LastItem()
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUWFFirstAndLastItems
getting the first and last items in the list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FirstAndLastItems() )
#--> [ 5, 1 ]
composed from the signature, run for this page no extensionLastAndFirstItems
getting the first and last items in the list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.LastAndFirstItems() )
#--> [ 1, 5 ]
composed from the signature, run for this page no extensionCentralPosition
getting the central position in the list
also written: CentralItemPositioncomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CentralPosition()
#--> 2
composed from the signature, run for this page no extensionCentralItem
getting the central item in the list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CentralItem()
#--> 3
composed from the signature, run for this page QCSXTZZZIBWUHasCentralItem
checking if the string has a central item
also written: ContainsCentralItemcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasCentralItem()
#--> 1
composed from the signature, run for this page no extensionNFirstItems
getting the list of n first items
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.NFirstItems(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUQRTNLastItems
getting the list of n last items
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.NLastItems(2) )
#--> [ 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUQRTgetting next/previous n items from a position
1 examples runno extensionReplace the whole content with the given list (mutating; the enforcement guard sits at _SetContent, the single update point).
1 examples runo1 = new stzList("A":"E")
o1.Update([])
? @@( o1.Content() )
#--> [ ]library testQCSXTZZZIBWUUpdateWith
Same as Update: replace the whole content (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.UpdateWith([ 2, 3 ])
? @@( o1.Content() )
#--> [ 2, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUUpdateBy
Same as Update: replace the whole content (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.UpdateBy([ 2, 3 ])
? @@( o1.Content() )
#--> [ 2, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUUpdated
The value the list would be updated to (the passive twin of Update).
also written: UpdatedBy · UpdatedWithcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Updated([ 2, 3 ]) )
#--> [ 2, 3 ]
composed from the signature, run for this page no extensionAddItem
Add the given item at the end of the list (mutating).
also named: append push add element put at the endcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.AddItem(3)
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 1, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUAdd
Same as AddItem: Add the given item at the end of the list (mutating).
also named: append push add to the end put at the backcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Add(3)
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 1, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUManyAppend
Same as AddItem: append the item at the end (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Append(3)
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 1, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUItemAdded
A copy of the list with the item appended; the original is unchanged.
also written: Addedcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemAdded(3) )
#--> [ 5, 3, 8, 3, 1, 3 ]
composed from the signature, run for this page no extensionManyAdded
A copy with each item of paItems appended; the original is unchanged.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ManyAdded([ 2, 3 ]) )
#--> [ 5, 3, 8, 3, 1, 2, 3 ]
composed from the signature, run for this page no extensionMergeWith
merging with another list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.MergeWith([ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 1, 2, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUManyMergedWith
merging with another list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.MergedWith([ 2, 3 ]) )
#--> [ 5, 3, 8, 3, 1, 2, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUManyadding an item at a given position --> insert or extend
2 examples runo1 = new stzList(1:5)
o1.AddItemAt(8, 9)
? @@( o1.Content() )
#--> [ 1, 2, 3, 4, 5, "", "", 9 ]
library testQCSXTZZZIBWUAddItems
adding many items to the list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.AddItems([ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 1, 2, 3 ]
composed from the signature, run for this page no extensionTRUE if the list has no items.
1 examples runalso named: empty blank has no items nothing in it contains nothing# Sum([1,2,3,4]) is 10
? Q([1,2,3,4]).Sum()
# IsEmpty([]) is TRUE
? Q([]).IsEmpty()
# IsEmpty([1]) is FALSE
? Q([1]).IsEmpty()
#--> 10
#--> 1
#--> 0
library testno extensionIsNotEmpty
TRUE if the list has at least one item.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsNotEmpty()
#--> 1
composed from the signature, run for this page no extensionIsNamedParam
Generic: checks if this list is a named param (2-item, first is keyword)no extension
IsAndNamedParam
(no comment in the source: the name reads as a sentence) is and named paramin the section named-param checks (needed by q() calls)no extension
IsAtNamedParam
(no comment in the source: the name reads as a sentence) is at named paramin the section named-param checks (needed by q() calls)no extension
IsAtOrAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is at or at position named paramin the section named-param checks (needed by q() calls)no extension
IsAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is at position named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenNamedParam
(no comment in the source: the name reads as a sentence) is between named paramin the section named-param checks (needed by q() calls)no extension
IsByNamedParam
(no comment in the source: the name reads as a sentence) is by named paramin the section named-param checks (needed by q() calls)no extension
IsCaseSensitiveNamedParam
(no comment in the source: the name reads as a sentence) is case sensitive named paramin the section named-param checks (needed by q() calls)no extension
IsDirectionOrGoingNamedParam
(no comment in the source: the name reads as a sentence) is direction or going named paramin the section named-param checks (needed by q() calls)no extension
IsEqualToNamedParam
(no comment in the source: the name reads as a sentence) is equal to named paramin the section named-param checks (needed by q() calls)no extension
IsFromNamedParam
(no comment in the source: the name reads as a sentence) is from named paramin the section named-param checks (needed by q() calls)no extension
IsInNamedParam
(no comment in the source: the name reads as a sentence) is in named paramin the section named-param checks (needed by q() calls)no extension
IsNorNamedParam
(no comment in the source: the name reads as a sentence) is nor named paramin the section named-param checks (needed by q() calls)no extension
IsOfNamedParam
(no comment in the source: the name reads as a sentence) is of named paramin the section named-param checks (needed by q() calls)no extension
IsOfOrOfSubStringNamedParam
(no comment in the source: the name reads as a sentence) is of or of sub string named paramin the section named-param checks (needed by q() calls)no extension
IsPositionNamedParam
(no comment in the source: the name reads as a sentence) is position named paramin the section named-param checks (needed by q() calls)no extension
IsPositionOrPositionsNamedParam
(no comment in the source: the name reads as a sentence) is position or positions named paramin the section named-param checks (needed by q() calls)no extension
IsReturnedAsNamedParam
(no comment in the source: the name reads as a sentence) is returned as named paramin the section named-param checks (needed by q() calls)no extension
IsStartingAtNamedParam
(no comment in the source: the name reads as a sentence) is starting at named paramin the section named-param checks (needed by q() calls)no extension
IsStoppingAtNamedParam
(no comment in the source: the name reads as a sentence) is stopping at named paramin the section named-param checks (needed by q() calls)no extension
IsToNamedParam
(no comment in the source: the name reads as a sentence) is to named paramin the section named-param checks (needed by q() calls)no extension
IsUsingOrWithOrByNamedParam
(no comment in the source: the name reads as a sentence) is using or with or by named paramin the section named-param checks (needed by q() calls)no extension
IsWhereNamedParam
(no comment in the source: the name reads as a sentence) is where named paramin the section named-param checks (needed by q() calls)no extension
IsWithNamedParam
(no comment in the source: the name reads as a sentence) is with named paramin the section named-param checks (needed by q() calls)no extension
IsWithOrByNamedParam
(no comment in the source: the name reads as a sentence) is with or by named paramin the section named-param checks (needed by q() calls)no extension
IsWithOrByOrUsingNamedParam
(no comment in the source: the name reads as a sentence) is with or by or using named paramin the section named-param checks (needed by q() calls)no extension
IsAndcColNamedNamedParam
(no comment in the source: the name reads as a sentence) is andc col named named paramin the section named-param checks (needed by q() calls)no extension
IsAndcColNamedParam
(no comment in the source: the name reads as a sentence) is andc col named paramin the section named-param checks (needed by q() calls)no extension
IsAndColAtNamedParam
(no comment in the source: the name reads as a sentence) is and col at named paramin the section named-param checks (needed by q() calls)no extension
IsAndColAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is and col at position named paramin the section named-param checks (needed by q() calls)no extension
IsAndColumnAtNamedParam
(no comment in the source: the name reads as a sentence) is and column at named paramin the section named-param checks (needed by q() calls)no extension
IsAndColumnAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is and column at position named paramin the section named-param checks (needed by q() calls)no extension
IsAndColumnNamedNamedParam
(no comment in the source: the name reads as a sentence) is and column named named paramin the section named-param checks (needed by q() calls)no extension
IsAndColumnNamedParam
(no comment in the source: the name reads as a sentence) is and column named paramin the section named-param checks (needed by q() calls)no extension
IsAndPositionNamedParam
(no comment in the source: the name reads as a sentence) is and position named paramin the section named-param checks (needed by q() calls)no extension
IsAndReturningNamedParam
(no comment in the source: the name reads as a sentence) is and returning named paramin the section named-param checks (needed by q() calls)no extension
IsAndReturningNthNamedParam
(no comment in the source: the name reads as a sentence) is and returning nth named paramin the section named-param checks (needed by q() calls)no extension
IsAndReturnNamedParam
(no comment in the source: the name reads as a sentence) is and return named paramin the section named-param checks (needed by q() calls)no extension
IsAndReturnNthNamedParam
(no comment in the source: the name reads as a sentence) is and return nth named paramin the section named-param checks (needed by q() calls)no extension
IsAndRowAtNamedParam
(no comment in the source: the name reads as a sentence) is and row at named paramin the section named-param checks (needed by q() calls)no extension
IsAndRowAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is and row at position named paramin the section named-param checks (needed by q() calls)no extension
IsAndRowNamedParam
(no comment in the source: the name reads as a sentence) is and row named paramin the section named-param checks (needed by q() calls)no extension
IsBetweencColNamedParam
(no comment in the source: the name reads as a sentence) is betweenc col named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenColAtNamedParam
(no comment in the source: the name reads as a sentence) is between col at named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenColAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is between col at position named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenColumnAtNamedParam
(no comment in the source: the name reads as a sentence) is between column at named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenColumnAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is between column at position named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenColumnNamedParam
(no comment in the source: the name reads as a sentence) is between column named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenPositionNamedParam
(no comment in the source: the name reads as a sentence) is between position named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenPositionsNamedParam
(no comment in the source: the name reads as a sentence) is between positions named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenRowAtNamedParam
(no comment in the source: the name reads as a sentence) is between row at named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenRowAtPositionNamedParam
(no comment in the source: the name reads as a sentence) is between row at position named paramin the section named-param checks (needed by q() calls)no extension
IsBetweenRowNamedParam
(no comment in the source: the name reads as a sentence) is between row named paramin the section named-param checks (needed by q() calls)no extension
IsByColOrByColNumberNamedParam
(no comment in the source: the name reads as a sentence) is by col or by col number named paramin the section named-param checks (needed by q() calls)no extension
IsByOrUsingOrWithNamedParam
(no comment in the source: the name reads as a sentence) is by or using or with named paramin the section named-param checks (needed by q() calls)no extension
IsByOrWithOrUsingNamedParam
(no comment in the source: the name reads as a sentence) is by or with or using named paramin the section named-param checks (needed by q() calls)no extension
IsByRowNamedParam
(no comment in the source: the name reads as a sentence) is by row named paramin the section named-param checks (needed by q() calls)no extension
IsComingNamedParam
(no comment in the source: the name reads as a sentence) is coming named paramin the section named-param checks (needed by q() calls)no extension
IsFromOrOfNamedParam
(no comment in the source: the name reads as a sentence) is from or of named paramin the section named-param checks (needed by q() calls)no extension
IsFromPositionNamedParam
(no comment in the source: the name reads as a sentence) is from position named paramin the section named-param checks (needed by q() calls)no extension
IsInANamedParam
(no comment in the source: the name reads as a sentence) is in a named paramin the section named-param checks (needed by q() calls)no extension
IsInOrInListNamedParam
(no comment in the source: the name reads as a sentence) is in or in list named paramin the section named-param checks (needed by q() calls)no extension
IsInOrInStringNamedParam
(no comment in the source: the name reads as a sentence) is in or in string named paramin the section named-param checks (needed by q() calls)no extension
IsOfSizeNamedParam
(no comment in the source: the name reads as a sentence) is of size named paramin the section named-param checks (needed by q() calls)no extension
IsReturningNamedParam
(no comment in the source: the name reads as a sentence) is returning named paramin the section named-param checks (needed by q() calls)no extension
IsReturningNthNamedParam
(no comment in the source: the name reads as a sentence) is returning nth named paramin the section named-param checks (needed by q() calls)no extension
IsReturnNamedParam
(no comment in the source: the name reads as a sentence) is return named paramin the section named-param checks (needed by q() calls)no extension
IsReturnNthNamedParam
(no comment in the source: the name reads as a sentence) is return nth named paramin the section named-param checks (needed by q() calls)no extension
IsSeedNamedParam
(no comment in the source: the name reads as a sentence) is seed named paramin the section named-param checks (needed by q() calls)no extension
IsSizeNamedParam
(no comment in the source: the name reads as a sentence) is size named paramin the section named-param checks (needed by q() calls)no extension
IsToOrOfNamedParam
(no comment in the source: the name reads as a sentence) is to or of named paramin the section named-param checks (needed by q() calls)no extension
IsToPositionNamedParam
(no comment in the source: the name reads as a sentence) is to position named paramalso written: IsToOrToPosition · IsToPositionOrToin the section named-param checks (needed by q() calls)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsToOrToPosition()
#--> 0
composed from the signature, run for this page no extension Same as AllItemsAreEqualCS: AllItemsAreEqualCS: TRUE iff every item in the list equals every other item (i.e. all items collapse to a single value). Case-sensitivity applies only when items are strings.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AllItemsAreEqual()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUAllAreEqual
Same as AllItemsAreEqualCS: AllItemsAreEqualCS: TRUE iff every item in the list equals every other item (i.e. all items collapse to a single value). Case-sensitivity applies only when items are strings.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AllAreEqual()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUIsWithRowNamedParam
(no comment in the source: the name reads as a sentence) is with row named paramin the section named-param checks (needed by q() calls)no extension
The list rendered as a computable string (the @@ form).
6 examples runalso written: ToCode · ToListInStringo1 = new stzList([ "A", "b", "C", "B", '"B",', "D", "E" ])
? o1.ToCode()
#--> [ "A", "b", "C", "B", '"B",', "D", "E" ]
library testQCSXTZZZIBWUToString
ToString: a plain display form -- the items rendered one per line (monolith semantics: ToStringXT(:ConcatenatedUsing = NL)). Overrides the stzObject default so a stzList stringifies to its content, not to an "@noname" object handle.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ToString()
#--> 5
#--> 3
#--> 8
#--> 3
#--> ...
composed from the signature, run for this page QCSXTZZZIBWUShow
Print the list to stdout in its computable @@ form.no extension
ShowShort
Print an abbreviated form of the list (first items ... last items).QCSXTZZZIBWU
ShowShortN
Print the abbreviated form showing n items at each end.no extension
ClassName
The lowercase class name: "stzlist".
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ClassName()
#--> stzlist
composed from the signature, run for this page no extensionStzType
The Softanza type symbol: :stzList.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.StzType()
#--> stzlist
composed from the signature, run for this page no extensionReplace
(no comment in the source: the name reads as a sentence) replacein the section replace delegations (via stzlistreplacer)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Replace(3, 2)
? @@( o1.Content() )
#--> [ 5, 2, 8, 2, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWFMany ReplaceNth
(no comment in the source: the name reads as a sentence) replace nthin the section replace delegations (via stzlistreplacer)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceNth(2, 3, 5)
? @@( o1.Content() )
#--> [ 5, 3, 8, 5, 1 ]
composed from the signature, run for this page QCSXTZZZIBWU ReplaceNthOccurrence
Same as ReplaceNthOccurrenceCS: Occurrence-replace delegation, accepting the named-param call form ReplaceNthOccurrence(n, :Of = item, :With = newItem).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceNthOccurrence(2, 3, 5)
? @@( o1.Content() )
#--> [ 5, 3, 8, 5, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUReplacePreviousNthOccurrence
Same as ReplacePreviousNthOccurrenceCS: Replace the nth occurrence of an item counting backward from a given position. Named form: ReplacePreviousNthOccurrence(n, :Of=item, :By=new, :StartingAt=p)QCSXTZZZIBWU
FindNextNthOccurrencesCS
(no comment in the source: the name reads as a sentence) find next nth occurrences csin the section replace delegations (via stzlistreplacer)no extension
ReplacePreviousNthOccurrences
(no comment in the source: the name reads as a sentence) replace previous nth occurrencesin the section replace delegations (via stzlistreplacer)QCSXTZZZIBWUST
ReplaceNextNthOccurrences
(no comment in the source: the name reads as a sentence) replace next nth occurrencesin the section replace delegations (via stzlistreplacer)QCSXTZZZIBWUST
NextNthOccurrencesReplaced
Passive (non-mutating) forms: return a fresh content list.no extension
PreviousNthOccurrencesReplaced
(no comment in the source: the name reads as a sentence) previous nth occurrences replacedin the section replace delegations (via stzlistreplacer)no extension
ReplaceAllItems
Replace every item by a single new one: ReplaceAllItems(:With = newItem) or ReplaceAllItems(newItem).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceAllItems(2)
? @@( o1.Content() )
#--> [ 2, 2, 2, 2, 2 ]
composed from the signature, run for this page QCSXTZZZIBWUReplaceFirst
(no comment in the source: the name reads as a sentence) replace firstin the section replace delegations (via stzlistreplacer)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceFirst(3, 2)
? @@( o1.Content() )
#--> [ 5, 2, 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWU ReplaceLast
(no comment in the source: the name reads as a sentence) replace lastin the section replace delegations (via stzlistreplacer)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceLast(3, 2)
? @@( o1.Content() )
#--> [ 5, 3, 8, 2, 1 ]
composed from the signature, run for this page QCSXTZZZIBWU Same as ReplaceManyByManyCS: replacing many items by many
3 examples runo1 = new stzList([ "A", "B", "*", "D", "*", "=" ])
o1.ReplaceManyByMany([ "*", "=" ], :With = ["C", "F"])
? @@( o1.Content() )
#--> [ "A", "B", "C", "D", "C", "F" ]
library testQCSXTZZZIBWUReplaceSection: the section [n1..n2] is replaced by ONE new item -- -- if that item is a list, it is inserted as a SINGLE element. This is -- the canonical Softanza semantics (see ReplaceSectionByMany to splice).
2 examples runo1 = new stzList([ "1", "2", "_", "_", "_", "4", "5" ])
o1.ReplaceSection(3, 5, :With = "3")
? @@( o1.Content() )
#--> [ "1", "2", "3", "4", "5" ]
library testQCSXTZZZIBWUSame as ReplaceSectionByManyCS: ReplaceSectionByMany: the section [n1..n2] is replaced by SPLICING -- the items of paNewItems in place (flattened one level into the list).
1 examples runo1 = new stzList([ "A", "B", "C", "1", "2", "3", "D", "E" ])
o1.ReplaceSectionByMany(4, 6, [ "*", "*", "*", "*" ])
? @@( o1.Content() )
#--> [ "A", "B", "C", "*", "*", "*", "*", "D", "E" ]
library testQCSXTZZZIBWUPositional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.
5 examples runo1 = new stzList([ "A", "a", "A" ])
o1.ReplaceAt(2, :By = "A")
? o1.Content()
#--> A
#--> A
#--> A
library testQCSXTZZZIBWUUpdateAt
Same as ReplaceAt: Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.UpdateAt(2, 5)
? @@( o1.Content() )
#--> [ 5, 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionSetItemAt
Same as ReplaceAt: Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SetItemAt(2, 5)
? @@( o1.Content() )
#--> [ 5, 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionSame as ReplaceAt: Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.
1 examples runo1 = new stzList([ 1, 2, "♥", 4, "♥" ])
o1.ReplaceAnyItemAt(3, :With = "★")
? @@( o1.Content() )
#--> [ 1, 2, "★", 4, "♥" ]
library testno extensionReplaceItemAtPosition
Same as ReplaceAt: Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceItemAtPosition(2, 5)
? @@( o1.Content() )
#--> [ 5, 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionReplaceAnyItemAtPositions
Set whatever lives at each of panPos to pNewItem.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceAnyItemAtPositions([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ 5, 2, 2, 3, 1 ]
composed from the signature, run for this page no extensionReplaceAnyItemsAtPositions
Same as ReplaceAnyItemAtPositions: Set whatever lives at each of panPos to pNewItem.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceAnyItemsAtPositions([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ 5, 2, 2, 3, 1 ]
composed from the signature, run for this page no extensionReplaceItemsAtPositions
Same as ReplaceAnyItemAtPositions: Set whatever lives at each of panPos to pNewItem.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceItemsAtPositions([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ 5, 2, 2, 3, 1 ]
composed from the signature, run for this page no extensionReplaceAtPositions
Same as ReplaceAnyItemAtPositions: Set whatever lives at each of panPos to pNewItem.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceAtPositions([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ 5, 2, 2, 3, 1 ]
composed from the signature, run for this page no extensionReplaceThisItemAtPositions
Same as ReplaceThisItemAtPositionsCS: At each of panPos, replace ONLY if the item there equals pItem.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceThisItemAtPositions([ 2, 3 ], 3, 2)
? @@( o1.Content() )
#--> [ 5, 2, 8, 3, 1 ]
composed from the signature, run for this page no extensionpositional replacers (ported from the monolith)
2 examples runo1 = new stzList([ 1, 2, "♥", 4, "♥" ])
o1.ReplaceThisItemAt(3, "♥", :With = "★")
? @@( o1.Content() )
o1.ReplaceThisItemAt(2, "BLA", :With = "★" )
? @@( o1.Content() )
#--> [ 1, 2, "★", 4, "♥" ]
#--> [ 1, 2, "★", 4, "♥" ]
library testno extensionReplaceTheseItemsAtPositions
Same as ReplaceTheseItemsAtPositionsCS: At each of panPos, replace if the item there is a member of paItems.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceTheseItemsAtPositions([ 2, 3 ], [ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ 5, 2, 8, 3, 1 ]
composed from the signature, run for this page no extensionSame as ReplaceByManyCS: Replace the k-th occurrence of pItem with paNewItems[k] (in order).
1 examples runo1 = new stzList([ "♥", 2, "♥", "♥", 5, "♥" ])
o1.ReplaceByMany("♥", [ 1, 3, 4, 6 ])
? @@( o1.Content() )
#--> [ 1, 2, 3, 4, 5, 6 ]library testQCSXTZZZIBWUReplaceItemByManyXT
Same as ReplaceByManyXT: Same as ReplaceByManyCSXT: Cycling variant: paNewItems is reused round-robin across occurrences.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceItemByManyXT(3, [ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 2, 8, 3, 1 ]
composed from the signature, run for this page no extensionReplace items at the GIVEN positions with paNewItems consumed in order.
2 examples runo1 = new stzList([ "A", "B", "*", "D", "*", "=" ])
o1.ReplaceOccurrencesByMany([ 3, 5, 6 ], ["C", "E", "F"])
? @@( o1.Content() )
#--> [ "A", "B", "C", "D", "E", "F" ]
library testQCSXTZZZIBWUSame as ReplaceItemAtPositionsByManyCS: At the panPos that hold pItem, replace the k-th such with paNewItems[k].
1 examples runo1 = new stzList([ "♥", 2, "♥", "♥", 5 ])
o1.ReplaceItemAtPositionsByMany([1, 3, 4 ], "♥", [ 1, 3, 4 ])
? @@( o1.Content() )
#--> [ 1, 2, 3, 4, 5 ]
library testQCSXTZZZIBWUReplaceTheseItemsAtPositionsByMany
Same as ReplaceTheseItemsAtPositionsByManyCS: These items: apply the per-item position-replace for each item in turn.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceTheseItemsAtPositionsByMany([ 2, 3 ], [ 2, 3 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 2, 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUReplaceAnyItemAtPositionsByMany
Same as ReplaceAnyItemAtPositionsByManyCS: Any item: zip positions <-> news (no value filter), truncating to shorter.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceAnyItemAtPositionsByMany([ 2, 3 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 2, 3, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUReplaceAnyItemsAtPositionsByMany
Same as ReplaceAnyItemAtPositionsByMany: Same as ReplaceAnyItemAtPositionsByManyCS: Any item: zip positions <-> news (no value filter), truncating to shorter.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceAnyItemsAtPositionsByMany([ 2, 3 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 2, 3, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUSame as ReplaceAnyItemAtPositionsByManyXT: Same as ReplaceAnyItemAtPositionsByManyCSXT: XT: cycle news across ALL given positions.
1 examples runo1 = new stzList([ "_", "_", "3", "4", "5", "6", "7", "_", "_" ])
o1.ReplaceAtByManyXT(3:5, [ "-3", "-4", "-5" ])
? @@( o1.Content() )
#--> [ "_", "_", "-3", "-4", "-5", "6", "7", "_", "_" ]
library testno extensionReplaceItemsW
Same as ReplaceW: Replace every item matching the :Where boolean expr with the :By value. -- Matching positions come from the engine-backed FindAllW (@item placeholder).no extension
Same as ReplaceNextNthOccurrenceCS: Replace the n-th occurrence of pItem at or after position pnStartingAt.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceNextNthOccurrence(2, 3, 5, 2)
? @@( o1.Content() )
#--> [ 5, 3, 8, 5, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUSTReplaceNthNextOccurrenceST
Same as ReplaceNextNthOccurrence: Same as ReplaceNextNthOccurrenceCS: Replace the n-th occurrence of pItem at or after position pnStartingAt.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceNthNextOccurrenceST(2, 3, 5, 2)
? @@( o1.Content() )
#--> [ 5, 3, 8, 5, 1 ]
composed from the signature, run for this page no extensionstringifying the list (all items are forced to become strings)
2 examples runo1 = new stzList([ 120, "abc", 1:3 ])
o1.Stringify()
# stringifying_the_items_of_a_list example 1
? @@( o1.Content() )
#--> [ "120", "abc", "[ 1, 2, 3 ]" ]
library testQCSXTZZZIBWUToListInAString: the content rendered as a "[ ... ]" string (computable form). Delegates to stzListStringify, like the rest of this section.
1 examples run? @@( StzListQ( 4:8 ).ToListInAString() )
? @@( StzListQ( 4:8 ).ToListInAStringInShortForm() )
#--> "[ 4, 5, 6, 7, 8 ]"
#--> "4:8"
library testno extensionStringifyAndReplace: Stringify the content, then replace every occurrence of pItem with the supplied value (pWith). pWith accepts the :With named-param form or a bare string. StringifyAndReplaceQ(item, with) returns This. XT variant is just an alias for the moment -- the original Softanza distinguished "internal-staff" semantics, but they collapse to the same engine path here.
4 examples runo1 = new stzList([ "--_--", [ 12, "--_--", 10], "--_--", 9 ])
o1.StringifyAndReplace("_", "♥")
? @@( o1.Content() )
#--> [ "--♥--", '[ 12, "--♥--", 10 ]', "--♥--", "9" ]library testQCSXTZZZIBWUStringifyLowercase
StringifyLowercase / StringifyUppercase / StringifyAndLower / StringifyAndUpper -- Stringify then map case. Used by misc narrative tests that need a uniform-case string list.no extension
StringifyAndLower
Same as StringifyLowercase: StringifyLowercase / StringifyUppercase / StringifyAndLower / StringifyAndUpper -- Stringify then map case. Used by misc narrative tests that need a uniform-case string list.QCSXTZZZIBWU
StringifyUppercase
Same as Stringify: stringifying the list (all items are forced to become strings)no extension
StringifyAndUpper
Same as StringifyUppercase: Same as Stringify: stringifying the list (all items are forced to become strings)QCSXTZZZIBWU
StringifyLowercaseAndReplace / StringifyUppercaseAndReplace -- stringify + lower (or upper) every string item, THEN replace every occurrence of pItem with pWith. XT variant is alias.
1 examples runQCSXTZZZIBWUStringifyUppercaseAndReplace
stringify delegation (via stzliststringify)QCSXTZZZIBWU
contains delegations (via stzlistcomparator)
2 examples runalso written: IsMadeOfAnyOfThese · IsMadeOfOneOfTheseo1 = new stzList([ :monday, :monday, :monday ])
? o1.IsMadeOfOneOfThese([ :sunday, :monday, :saturday, :wednesday, :thirsday, :friday, :saturday ])
#--> 1
library testQCSXTZZZIBWUcontains delegations (via stzlistcomparator)
1 examples runo1 = new stzList([ "me", "you", "all", "the", "others" ])
# containseither example 1
? @@( o1.ContainsEither("me", :or = "you") )
o1 = new stzlist([ "me", "and", "all", "the", "others" ])
# containseither example 2
? @@( o1.ContainsEither("me", :or = "you") )
#--> 0
#--> 1library testQCSXTZZZIBWUcontains delegations (via stzlistcomparator)
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsAllOfThese([ 2, 3 ])
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU(no comment in the source: the name reads as a sentence) all items are of type 2 examples runalso written: EachItemIs · EachItemIsAin the section checker delegations (via stzlistchecker)o1 = new stzList([ 2, 4, 8 ])
? o1.EachItemIsA(:Number)
? o1.ItemsAre([ :Positive, :Even, :Numbers ])
#--> 1
#--> 1
library testno extension (no comment in the source: the name reads as a sentence) contains empty strings 1 examples runin the section checker delegations (via stzlistchecker)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsEmptyStrings()
#--> 0
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) find empty strings 1 examples runin the section checker delegations (via stzlistchecker)no extension (no comment in the source: the name reads as a sentence) count empty strings 1 examples runin the section checker delegations (via stzlistchecker)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CountEmptyStrings()
#--> 0
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) replace empty strings 1 examples runin the section checker delegations (via stzlistchecker)composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.ReplaceEmptyStrings(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) remove empty strings 1 examples runin the section checker delegations (via stzlistchecker)composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveEmptyStrings()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extension Sort by a key expression (engine-backed via the W DSL).
1 examples runo1 = new stzList([ "a", "abcde", "abc", "ab", "abcd" ])
o1.SortBy('len(@item)')
# sortby example 1
? @@( o1.Content() )
#--> [ "a", "ab", "abc", "abcd", "abcde" ]library testQCSXTZZZIBWUSortByDescending
Sort the items by the given expression, descending (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SortByDescending("@item > 3")
? @@( o1.Content() )
#--> [ 5, 8, 3, 3, 1 ]composed from the signature, run for this page no extensionnon-mutating: return the sorted-by-key copy
1 examples runo1 = new stzList([ "programming", "is" ])
# sortedby example 1
? @@( o1.SortedBy('len(@item)') )
#--> [ "is", "programming" ]library testno extensionSortUp
Same as Sort: ascending, in place (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SortUp()
? @@( o1.Content() )
#--> [ 1, 3, 3, 5, 8 ]
composed from the signature, run for this page QCSXTZZZIBWUSortDown
Same as SortInDescending: descending, in place (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SortDown()
? @@( o1.Content() )
#--> [ 8, 5, 3, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUSort the items in ascending order in place (mutating). For a copy, use Sorted.
2 examples runalso named: order arrange rank ascending smallest to largest? @@( StzListQ([ "him", [ "him" ], "" ]).Sorted() ) + NL
o1 = new stzList([ "him", [ "him" ], "" ])
o1.Stringify()
? @@( o1.Content() )
o1.Sort()
#--> [ "", "him", [ "him" ] ]
#--> [ "him", '[ "him" ]', "" ]
library testQCSXTZZZIBWUWord-order aliases used by narrative tests.
1 examples runo1 = new stzList([ 5, 4, "tunis", 3, 7, "cairo" ])
o1.SortInAscending()
# numbers rise first, then strings alphabetically
? @@( o1.Content() )
#--> [ 3, 4, 5, 7, "cairo", "tunis" ]
library testQCSXTZZZIBWUSortAscending
Same as Sort: Sort the items in ascending order in place (mutating). For a copy, use Sorted.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SortAscending()
? @@( o1.Content() )
#--> [ 1, 3, 3, 5, 8 ]
composed from the signature, run for this page QCSXTZZZIBWUAn ascending-sorted copy of the list; the original is unchanged.
3 examples runalso written: SortedInAscending · ItemsSortedInAscendingo1 = new stzList([ 5, 7, 9, 2 ])
? o1.SortedInAscending()
#--> 2
#--> 5
#--> 7
#--> 9
library testQCSXTZZZIBWUSortInDescending
Sort the items in descending order in place (mutating). For a copy, use SortedInDescending.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SortInDescending()
? @@( o1.Content() )
#--> [ 8, 5, 3, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUSame as SortedInDescendingCS: A descending-sorted copy of the list; the original is unchanged.
1 examples runo1 = new stzList([ ["03", "04"], 3, ["01","02"], 1, "Two", 2, "One" ])
? @@( o1.Sorted() ) # Or o1.SortedInAscending()
? @@( o1.SortedInDescending() )
#--> [ 1, 2, 3, "One", "Two", [ "01", "02" ], [ "03", "04" ] ]
#--> [ [ "03", "04" ], [ "01", "02" ], "Two", "One", 3, 2, 1 ]
library testQCSXTZZZIBWUReverse the order of the items in place (mutating). For a copy, use Reversed.
1 examples runalso named: flip backwards invert order last to firstcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Reverse()
? @@( o1.Content() )
#--> [ 1, 3, 8, 3, 5 ]
composed from the signature, run for this page QCSXTZZZIBWUA reversed copy of the list; the original is unchanged.
2 examples runalso written: ItemsReversedo1 = new stzList(1:3)
? o1.Reversed()
#--> 3
#--> 2
#--> 1
library testno extensionEvery item except those equal to p (p may be a single item).
2 examples runo1 = new stzList([ "A", "B", "_", "C", "D", "E", "F" ])
? @@( o1.AllItemsExcept("_") )
#--> [ "A", "B", "C", "D", "E", "F" ]library testno extensionFirst n items (clamped to the list length; n<=0 -> empty).
2 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FirstNItems(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUQRTMax nesting depth (a flat list is 1 level).
1 examples runalso written: NestingDepthcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfLevels()
#--> 1
composed from the signature, run for this page no extensionTRUE if any two adjacent items are equal.
1 examples runalso written: ContainsConsecutiveDuplicateso1 = new stzList([ "A", "B", "C" ])
# containsdupsecutiveitems example 1
? @@( o1.ContainsDupSecutiveItems() )
#--> 0
library testno extensionManyRemoved
A fresh copy with every occurrence of any item in paItems removed.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ManyRemoved([ 2, 3 ]) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extensionTRUE if this list's items appear inside paOther in the same relative order (i.e. this list is an order-preserving subsequence of paOther).
1 examples runo1 = new stzList([ "a", "c" ])
? o1.ItemsHaveSameOrderAs([ "a", "c", "f" ])
#--> 1
library testno extensionTRUE if the list contains the given item.
9 examples runalso named: includes has is in member of present holdso1 = new stzList("a":"t")
? o1.Contains("x")
#--> 0library testQCSXTZZZIBWUWFMany(no comment in the source: the name reads as a sentence) remove duplicates 4 examples runalso named: unique distinct dedupe remove repeats deduplicate drop duplicatesin the section remove duplicates / unique (engine-backed)o1 = new stzList([ 1:3, 4:6, 1:3, 1:3, 4:6, 7:10 ])
o1.Removeduplicates()
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9, 10 ] ]
library testQCSXTZZZIBWU Immutable / past-tense aliases for the dedup operation. DuplicatesRemoved() returns the deduped list value without mutating This (equivalent to WithoutDuplication, ported from archive line 41406). Used by stzHashList.UniqueValues(). (case-sensitive by default)
5 examples runalso written: ToSet · ToSetOfItems? @@( StzListQ([ "tea", "rice", "tea" ]).DuplicatesRemoved() )
#--> [ "tea", "rice" ]
library testQCSXTZZZIBWUToStzListOfCharsQ
(no comment in the source: the name reads as a sentence) to stz list of chars qin the section remove duplicates / unique (engine-backed)no extension
(no comment in the source: the name reads as a sentence) without duplication 2 examples runalso written: Uniquein the section remove duplicates / unique (engine-backed)o1 = new stzList([ "A", "B", "2", "A", "A", "B", 2, 2, "." ])
? @@( o1.Withoutduplication() ) # Or ToSet()
#--> [ "A", "B", "2", 2, "." ]
library testQCSXTZZZIBWU Same as ContainsDuplicatedItemsCS: TRUE if some item occurs more than once in the list.
5 examples runalso written: HasDuplicates · ContainsDuplicatesoW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
? oW.NumberOfDuplicates()
#--> 1
#--> 3
library testQCSXTZZZIBWUThe items that occur more than once in the list.
12 examples runalso named: repeated items doubles occur twice duplicatesalso written: DupOrigins · Duplicates · Duplications · DuplicatedStringso1 = new stzList([ 5, 7, 5, 5, 4, 7, 1 ])
? o1.Duplicates()
? o1.FindDuplicates()
#--> 5
#--> 7
#--> 3
#--> 4
#--> ...
library testQCSXTZZZIBWUNumberOfDuplicatedItems
Same as NumberOfDuplicatedItemsCS: How many duplicated items the list holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfDuplicatedItems()
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUNumberOfDuplicates counts the duplicate OCCURRENCES (every 2nd+ appearance), not the number of distinct duplicated items. For [ "A","B","2","A","A","B",2,2,"." ] that is 4 (A twice, B once, 2 once). NumberOfDuplicatedItems (distinct) would be 3.
5 examples runalso written: HowManyDuplicates · NumberOfDuplicationsoW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
? oW.NumberOfDuplicates()
#--> 1
#--> 3
library testQCSXTZZZIBWUThe position of every 2nd+ occurrence of each duplicated item.
5 examples runalso written: FindDuplications · FindDuplicatedItemso1 = new stzList([ 5, 7, 5, 5, 4, 7, 1 ])
? o1.Duplicates()
? o1.FindDuplicates()
#--> 5
#--> 7
#--> 3
#--> 4
#--> ...
library testQCSXTZZZIBWUDuplicateItemsZ
Same as DuplicatesCSZ: Duplicates() / DuplicateItems() / Duplications(): the duplicated items themselves (returning DuplicatedItems). The XYZ-Z forms above return positions; these return values. (returns the value along with its position; with the case-sensitivity dial)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DuplicateItemsZ() )
#--> [ [ 3, [ 4 ] ] ]
composed from the signature, run for this page no extensionFindNextNthItem(n, :StartingAt = pos): the POSITION of the n-th item AFTER pos (pos+n). Find* returns the position (0 if out of range); the NextNthItem accessor returns the item there. :StartingAt accepts the bare integer or the named-param form.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextNthItem(2, 5)
#--> 0
composed from the signature, run for this page no extensionFindPreviousNthItem(n, :StartingAt = pos): the POSITION of the n-th item counting BACK from pos inclusive (pos-n+1).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindPreviousNthItem(2, 5)
#--> 4
composed from the signature, run for this page no extensionThe nth item before the given position.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.PreviousNthItem(2, 5)
#--> 3
composed from the signature, run for this page no extensionFindDuplicatesOfString
Same as FindDuplicatesOfStringCS: "...OfString" is the historical name (these came from the list-of-strings API) but they work for any item type. The "duplicates" of an item are its 2nd-and-later occurrences -- the first one is the original, the rest are the copies.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDuplicatesOfString(3) )
#--> [ 4 ]
composed from the signature, run for this page QCSXTZZZIBWUFindDuplicatesOfItem
Same as FindDuplicatesOfStringCS: "...OfString" is the historical name (these came from the list-of-strings API) but they work for any item type. The "duplicates" of an item are its 2nd-and-later occurrences -- the first one is the original, the rest are the copies.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDuplicatesOfItem(3) )
#--> [ 4 ]
composed from the signature, run for this page QCSXTZZZIBWUFindDuplicationsOfItem
Same as FindDuplicatesOfStringCS: "...OfString" is the historical name (these came from the list-of-strings API) but they work for any item type. The "duplicates" of an item are its 2nd-and-later occurrences -- the first one is the original, the rest are the copies.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDuplicationsOfItem(3) )
#--> [ 4 ]
composed from the signature, run for this page QCSXTZZZIBWUFindDuplicationsOf
Same as FindDuplicatesOfStringCS: "...OfString" is the historical name (these came from the list-of-strings API) but they work for any item type. The "duplicates" of an item are its 2nd-and-later occurrences -- the first one is the original, the rest are the copies.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDuplicationsOf(3) )
#--> [ 4 ]
composed from the signature, run for this page no extensionNumberOfDuplicatesOfString
(no comment in the source: the name reads as a sentence) number of duplicates of stringin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfDuplicatesOfString(3)
#--> 1
composed from the signature, run for this page QCSXTZZZIBWU NumberOfDuplicatesOfItem
(no comment in the source: the name reads as a sentence) number of duplicates of itemin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfDuplicatesOfItem(3)
#--> 1
composed from the signature, run for this page QCSXTZZZIBWU StringIsDuplicatedNTimes
(no comment in the source: the name reads as a sentence) string is duplicated n timesin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.StringIsDuplicatedNTimes(3, 2)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU ItemIsDuplicatedNTimes
(no comment in the source: the name reads as a sentence) item is duplicated n timesin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ItemIsDuplicatedNTimes(3, 2)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU FindDuplicatedString
Same as FindDuplicatedStringCS: ALL positions of an item -- but only when it actually IS duplicated (appears more than once); a non-duplicated item yields the empty list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDuplicatedString(3) )
#--> [ 2, 4 ]
composed from the signature, run for this page QCSXTZZZIBWUFindDuplicatedItem
Same as FindDuplicatedStringCS: ALL positions of an item -- but only when it actually IS duplicated (appears more than once); a non-duplicated item yields the empty list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDuplicatedItem(3) )
#--> [ 2, 4 ]
composed from the signature, run for this page QCSXTZZZIBWUContainsDuplicatedString
(no comment in the source: the name reads as a sentence) contains duplicated stringin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsDuplicatedString(3)
#--> 1
composed from the signature, run for this page QCSXTZZZIBWU ContainsDuplicatedItem
(no comment in the source: the name reads as a sentence) contains duplicated itemin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsDuplicatedItem(3)
#--> 1
composed from the signature, run for this page QCSXTZZZIBWU NumberOfDuplicatedStrings
(no comment in the source: the name reads as a sentence) number of duplicated stringsin the section duplicates of a specific item / stringcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfDuplicatedStrings()
#--> 1
composed from the signature, run for this page QCSXTZZZIBWU Same as FindSubListCS: FindSubList / ContainsSubList: locate the contiguous occurrences of a sub-list inside the list.
1 examples runalso written: FindTheseAdjacentItems · FindTheseContiguousItemso1 = new stzList([ 1, 2, 3, 4, "|", 2, 3, 4, 5, "|", 2, 3, 4, 5 ])
? o1.FindSubList([ 2, 3, 4 ])
#--> 2
#--> 6
#--> 11
library testQCSXTZZZIBWUContainsSubList
Same as ContainsSubListCS: TRUE if the given sublist occurs in the list as a consecutive run of items.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsSubList([ 2, 3 ])
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUMerge: flatten ONE level only. For each item: if it's a list, spread its items; otherwise keep as-is. Distinct from Flatten() which fully recurses. Port from archive line 37074; used by stzHashList.Items() to coalesce list-of-lists values.
1 examples runcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.Merge()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUA copy flattened by ONE level: sublists spread out, other items kept as they are.
2 examples run? @@( Q([ 0, 1:3, 4:7, 8:10 ]).Merged() )
#--> [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
library testno extensionFlatten the nested list to a single level in place (mutating). For a copy, use Flattened.
1 examples runalso named: unnest merge levels single level ungroup collapse nestingcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.Flatten()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUA fully-flattened copy of the nested list; the original is unchanged.
3 examples run? @@( StzListQ([ "a", [ "b", [ "c", "d" ], "e" ], "f" ]).Flattened() )
#--> [ "a", "b", "c", "d", "e", "f" ]
library testno extensionequality check (set-based, engine-backed)
5 examples runo1 = new stzList([ "C", "A", "B" ])
? o1.IsEqualTo([ "A", "B", "C" ])
? o1.IsEqualToXT([ "A", "B", "C" ])
#--> 1
#--> 0
library testQCSXTZZZIBWUstrict equality (same items + same positions)
3 examples runalso written: IsIdenticalToo1 = new stzList([ 1, 2, 3 ])
? o1.IsEqualTo([ 3, 1, 2 ])
? o1.IsStrictlyEqualTo([ 3, 1, 2 ])
? o1.IsStrictlyEqualTo([ 1, 2, 3 ])
#--> 1
#--> 0
#--> 1
library testQCSXTZZZIBWUStartsWith
starts with / ends with (engine-backed)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.StartsWith([ 2, 3 ])
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUEndsWith
starts with / ends with (engine-backed)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.EndsWith([ 2, 3 ])
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUexpression-backed operations (engine bytecode)
2 examples runalso written: Yieldcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Map("@item > 3") )
#--> [ 1, 0, 1, 0, 0 ]composed from the signature, run for this page QCSXTZZZIBWUWFFilter
expression-backed operations (engine bytecode)
also named: keep where select subset matching items pick outcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Filter("@item > 3") )
#--> [ 5, 8 ]composed from the signature, run for this page QCSXTZZZIBWUWFReduce(): 0-arg auto-concat / auto-sum. - All-string items: concatenate. - All-number items: sum. - Mixed: concatenate stringified items.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Reduce()
#--> 20
composed from the signature, run for this page QCSXTZZZIBWUexpression-backed operations (engine bytecode)
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ReduceNoInit("@item > 3")
#--> 0composed from the signature, run for this page no extensionCountWhere
Same as CountW: Same as NumberOfOccurrenceCS: NumberOfOccurrenceCS: count occurrences How many times the given item occurs in the list. (applies only where the given W condition holds)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CountWhere("@item > 3")
#--> 2composed from the signature, run for this page no extensionCountItemsW
Same as CountW: Same as NumberOfOccurrenceCS: NumberOfOccurrenceCS: count occurrences How many times the given item occurs in the list. (applies only where the given W condition holds)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CountItemsW("@item > 3")
#--> 2composed from the signature, run for this page no extensionIsSorted
TRUE if the items are sorted, ascending OR descending.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsSorted()
#--> 0
composed from the signature, run for this page no extensionTRUE if the items are in ascending order.
1 examples runo1 = new stzList([ 3, 6, 9, 12, "a", "b", [ "List0" ], [ "List1" ] ])
? o1.IsSortedInAscending()
#--> 1
library testno extensionIsSortedInDescending
TRUE if the items are in descending order.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsSortedInDescending()
#--> 0
composed from the signature, run for this page no extensionSortingOrder
The sorting order of the items (:Ascending, :Descending, ...).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.SortingOrder()
#--> unsorted
composed from the signature, run for this page no extensionTRUE if the given list is sorted the same way as this one.
2 examples run? ListContains([ "q", "r", [ 2, 1 ] ], [ 2, 1 ])
? StzListQ([ "q", "r", [ 2, 1] ]).HasSameContentAs([ "r", [ 2, 1], "q" ])
? StzListQ([ "q", "r", [ 2, 1] ]).HasSameSortingOrderAs([ "r", [ 2, 1], "q" ])
? StzListQ([ "q", "r", [ 2, 1] ]).IsEqualTo([ "q", "r", [2, 1] ])
#--> 1
#--> 1
#--> 0
#--> 1
library testno extensionHasSameContentAs: order-independent equality check. Two lists have the same content iff each is a permutation of the other -- same length, and every item in A appears (with the same multiplicity) in B. Walk-and-mark, O(N*M) -- fine for narrative test sizes; lift to a hash-based approach when called on large lists in real code paths.
4 examples runalso written: SameContentAs · IsEquivalentToo1 = new stzList([ "a", "c", 12 ])
? o1.HasSameContentAs([ "a", 12, "c" ])
#--> 1
library testno extensionTRUE if every item is a [key, value] pair (a hash list).
1 examples runalso written: IsAHashListaList = [ :name = "mansour", :job = "programmer", :name = "xe" ]
o1 = new stzList(aList)
? o1.IsHashList()
#--> 0
library testno extensionIsNotHashList
TRUE if the list is NOT a hash list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsNotHashList()
#--> 1
composed from the signature, run for this page no extensionToStzHashList
ToStzHashList: view this list (a hashlist / list of [key,value] pairs, e.g. [ :a = 1, :b = 2 ]) as a stzHashList, so you can chain KeysQ(), ValuesQ(), etc. The stzHashList ctor normalizes a list of pairs.also written: ToHashListQCSXTZZZIBWU
TRUE if the list holds exactly two items.
1 examples runalso written: IsAPaircomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsPair()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUTRUE if the list is non-empty and every item is a string.
2 examples runalso written: IsListOfTexts · IsAListOfTexts · IsAListOfStrings? IsListOfStrings([ "baba", "ommi", "jeddy" ])
? Q([ "baba", "ommi", "jeddy" ]).IsListOfStrings()
#--> 1
#--> 1
library testno extensionAn empty list answers 0, matching IsListOfStrings just above, which also refuses to make a claim about content that is not there.
2 examples runalso written: AllItemsAreUppercase# the pair is an :AtChars named param
? Q([ "atchars", "Q(@char).IsUppercase()" ]).IsAtCharsNamedParam()
#--> 1
library testno extensionIsLowercase
type-checking methods
also written: AllItemsAreLowercasecomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsLowercase()
#--> 0
composed from the signature, run for this page no extensionTRUE if the list is non-empty and every item is a number.
1 examples runalso written: IsAListOfNumberscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfNumbers()
#--> 1
composed from the signature, run for this page no extensionTRUE if every item is a single char.
1 examples runalso written: IsAListOfChars# islistofchars example 1
? @@( Q([ "a", "b", "c" ]).IsListOfChars() )
# islistofchars example 2
? @@( Q([ 1, 2, 3 ]).IsListOfChars() )
#--> 1
#--> 1
library testno extensionPolymorphic membership test: IsListOf(:Numbers/:Strings/:Chars/ :Lists/:StzNumbers/:StzStrings/:ListsOfNumbers/:PairsOfNumbers).
2 examples runalso written: IsAListOfno extensionIsListOfLists
TRUE if every item is a list (vacuously TRUE when empty).
also written: IsAListOfLists · AllItemsAreLists · ContainsOnlyListscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfLists()
#--> 0
composed from the signature, run for this page no extensionIsListOfListsOfNumbers
IsListOfListsOfNumbers: each top-level item must be a list, and each inner item must be a number.
also written: IsAListOfListsOfNumberscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfListsOfNumbers()
#--> 0
composed from the signature, run for this page no extensionIsListOfListsOfSameSize
TRUE if every item is a list and all the sublists have the same size.
also written: ItemsAreListsOfSameSize · AllItemsAreListsOfSameSizecomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfListsOfSameSize()
#--> 0
composed from the signature, run for this page no extensionIsPairOfNumbers
TRUE if the list is exactly a pair of two numbers.
also written: IsAPairOfNumberscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsPairOfNumbers()
#--> 0
composed from the signature, run for this page no extensionIsListOfPairs
TRUE if every item is a pair (vacuously TRUE when empty).
also written: IsAListOfPairscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfPairs()
#--> 0
composed from the signature, run for this page no extensionIsContiguous
True iff the list of numbers is sorted ascending with consecutive values (e.g. [3,4,5] -> TRUE, [3,5,6] -> FALSE).
also written: AreContiguouscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsContiguous()
#--> 0
composed from the signature, run for this page no extensionIsListOfPairsOfNumbers
TRUE if every item is a pair of numbers.
also written: IsAListOfPairsOfNumberscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfPairsOfNumbers()
#--> 0
composed from the signature, run for this page no extensionIsListOfPairsOfStrings
TRUE if every item is a pair of strings.
also written: IsAListOfPairsOfStringscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfPairsOfStrings()
#--> 0
composed from the signature, run for this page no extensionIsSet
TRUE if all the items are unique (the list is a set).
also written: IsASetcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsSet()
#--> 0
composed from the signature, run for this page no extensionList
List() alias The raw Haro list content (same as Content).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.List() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUSame as SectionCS: Section: extract items between two positions
3 examples runo1 = new stzList(1:10)
# section example 1
? @@( o1.Section(3, 10) )
#--> [ 3, 4, 5, 6, 7, 8, 9, 10 ]
library testQCSXTZZZIBWURange: extract items from a start position for a given count
1 examples runQCSXTZZZIBWUInsertAt: insert an item at a given position
1 examples runo1 = new stzList([ "A", "C", "D" ])
o1.InsertAt(2, "B")
? o1.Content()
#--> A
#--> B
#--> C
#--> D
library testQCSXTZZZIBWUSame as InsertAt: InsertAt: insert an item at a given position
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.InsertBefore(2, 3)
? @@( o1.Content() )
#--> [ 5, 3, 3, 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWFRemoveItemAtPosition
RemoveItemAtPosition: remove item at a specific position
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveItemAtPosition(2)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWURemoveAt
Same as RemoveItemAtPosition: RemoveItemAtPosition: remove item at a specific position
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveAt(2)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionRemoveItemsAtPositions: remove items at multiple positions
2 examples runo1 = new stzList([ "a", "b", "b", "b", "c" ])
o1.RemoveItemsAtPositions([2,3,4])
? o1.Content()
#--> a
#--> c
library testQCSXTZZZIBWURemoveItemsAtThesePositions
Same as RemoveItemsAtPositions: RemoveItemsAtPositions: remove items at multiple positions
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveItemsAtThesePositions([ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWURemoveSection: remove items between two positions
2 examples runo1 = new stzList([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ])
o1.RemoveSection(3, 8)
# removesection example 1
? @@( o1.Content() )
#--> [ 1, 2, 9, 10 ]
library testQCSXTZZZIBWURemoveSpaces
RemoveSpaces / RemoveSpacesQ: drop every " " item (string-space) from the content. Engine-aware: only removes string-typed " ".
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveSpaces()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWURemoveDuplicatedItems
RemoveDuplicatedItems / Q: in-place dedup. Order-preserving: keeps the first occurrence of each unique value.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveDuplicatedItems()
? @@( o1.Content() )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUIsReverseOf(paOther): TRUE iff @aContent is the reverse of paOther (deep-equal item-by-item).
1 examples runo1 = new stzList([ 1, 2, 3, 6 ])
? o1.IsReverseOf([ 6, 3, 2, 1 ])
#--> 1
library testno extensionRemoveFirstItem / RemoveLastItem Remove the first item of the list (mutating).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveFirstItem()
? @@( o1.Content() )
#--> [ 3, 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWURemoveLastItem
(no comment in the source: the name reads as a sentence) remove last itemin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveLastItem()
? @@( o1.Content() )
#--> [ 5, 3, 8, 3 ]
composed from the signature, run for this page QCSXTZZZIBWU RemoveFirstAndLastItems
Same as RemoveFirstItem: RemoveFirstItem / RemoveLastItem Remove the first item of the list (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveFirstAndLastItems()
? @@( o1.Content() )
#--> [ 3, 8, 3 ]
composed from the signature, run for this page QCSXTZZZIBWURemoveRange: remove items from start for a count
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveRange(2, 5)
? @@( o1.Content() )
#--> [ 5 ]
composed from the signature, run for this page no extensionRemoveAllItems
RemoveAllItems Empty the list (mutating).no extension
Find the given item: the positions of EVERY occurrence, as a list (engine-backed). (case-sensitive by default)
24 examples run# find example 1
? @@( Q([1, 2, 3, 4, 5, 3, 7]).Find(3) )
#--> [ 3, 6 ]
library testQCSXTZZZIBWUWFManySame as FindAllOccurrencesCS: FindAllOccurrencesCS: find all positions of an item
11 examples runo1 = new stzList([ 1:3, 4:6, 1:3, 1:3, 4:6, 7:10 ])
? o1.FindAll(1:3)
? o1.Contains(7:10)
#--> 1
#--> 3
#--> 4
#--> 1
library testQCSXTZZZIBWUWFExceptFindAllOccurrences
Same as FindAllOccurrencesCS: FindAllOccurrencesCS: find all positions of an item
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindAllOccurrences(3) )
#--> [ 2, 4 ]
composed from the signature, run for this page QCSXTZZZIBWU(no comment in the source: the name reads as a sentence) last n items 2 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.LastNItems(2) )
#--> [ 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUQRT AddedToEach
AddedToEach(n): add n to every numeric item; return a new list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.AddedToEach(2) )
#--> [ 7, 5, 10, 5, 3 ]
composed from the signature, run for this page no extensionAddToEach
(no comment in the source: the name reads as a sentence) add to eachin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.AddToEach(2)
? @@( o1.Content() )
#--> [ 7, 5, 10, 5, 3 ]
composed from the signature, run for this page no extension SectionsOfSameItems
SectionsOfSameItems(): group consecutive equal items into runs. "AABBCCAA" -> [["A","A"], ["B","B"], ["C","C"], ["A","A"]]
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SectionsOfSameItems() )
#--> [ [ 5 ], [ 3, 3 ], [ 8 ], [ 1 ] ]
composed from the signature, run for this page no extensionFindInSections
FindInSections(pItem, aSections): absolute-position occurrences of pItem inside any of the given sections.no extension
CountInSections
(no comment in the source: the name reads as a sentence) count in sectionsalso written: NumberOfOccurrencesInSectionsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CountInSections(3, [ 2, 3 ])
#--> 0
composed from the signature, run for this page no extension HexUnicodes
HexUnicodes(): hex code-points of every char of every string-item.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.HexUnicodes() )
#--> [ [ "U+0074", "U+0065", "U+0061" ], [ "U+0072", "U+0069", "U+0063", "U+0065" ], [ "U+0074", "U+0065", "U+0061" ], [ "U+0066", "U+0069", "U+0073", "U+0068" ] ]
composed from the signature, run for this page no extensionCommonItems(:With = otherList): items present in both lists.
1 examples runalso written: Intersectiono1 = new stzList([ "a", "ab", "b" ])
? @@( o1.Intersection(:with = [ "a", "ab", "abc", "b", "bc", "c" ]) ) # Or CommonItems()
#--> [ "a", "ab", "b" ]
library testno extensionPreviousNItems: two shapes -- PreviousNItems(n, :StartingAt/:StartingAtPosition = p): the n items strictly BEFORE position p; PreviousNItems(pcAnchor, n): the n items before the anchor item.
1 examples runno extensionSpacesRemoved
SpacesRemoved (non-mutating): every string item stripped of spaces.
also written: WithoutSapces · WithoutSpacescomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.SpacesRemoved() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSubStrongs
Substrongs/Substrinks (deliberate Softanza wordplay): the string items that CONTAIN another item of the list, and the ones that are CONTAINED IN another item (case-sensitive, engine-backed find).no extension
SubStrinks
(no comment in the source: the name reads as a sentence) sub strinksin the section essential methods for submodule supportno extension
Concatenate
(no comment in the source: the name reads as a sentence) concatenatein the section essential methods for submodule supportcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? o1.Concatenate()
#--> teariceteafish
composed from the signature, run for this page QCSXTZZZIBWU Concatenated
(no comment in the source: the name reads as a sentence) concatenatedin the section essential methods for submodule supportcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? o1.Concatenated()
#--> teariceteafish
composed from the signature, run for this page no extension NumbrifyQ
NumbrifyQ / NumbrifiedQ: coerce string-items to numbers and return the list wrapped. Test pattern: a CharsQ() walk that then wants per-char numeric values.no extension
NumbrifiedQ
Same as NumbrifyQ: NumbrifyQ / NumbrifiedQ: coerce string-items to numbers and return the list wrapped. Test pattern: a CharsQ() walk that then wants per-char numeric values.no extension
(no comment in the source: the name reads as a sentence) are 5 examples runalso written: ItemsArein the section essential methods for submodule supporto1 = new stzList([ 2, 4, 8 ])
? o1.EachItemIsA(:Number)
? o1.ItemsAre([ :Positive, :Even, :Numbers ])
#--> 1
#--> 1
library testno extension FindSpaces
(no comment in the source: the name reads as a sentence) find spacesin the section essential methods for submodule supportno extension
(no comment in the source: the name reads as a sentence) is not a string 1 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsNotAString()
#--> 1
composed from the signature, run for this page no extension IsAString
(no comment in the source: the name reads as a sentence) is a stringin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsString()
#--> 0
composed from the signature, run for this page · written IsAString() in the library today: the host language already holds IsString(), and Haro removes the detour no extension IsAList
So a stzList answered "no" to being a list, and every `but IsAList()` arm in the library fell past it. stzObject.IsEither() has such an arm, followed by `but IsAnObject()` -- which a stzList IS -- so comparing two lists raised "Feature not implemented yet!" from a branch meant for something else entirely.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsList()
#--> 1
composed from the signature, run for this page · written IsAList() in the library today: the host language already holds IsList(), and Haro removes the detour no extensionSAME SHAPE, SAME OMISSION. stzObject.HasSameTypeAs(p) answers isObject(p), and each wrapper overrides it to test the type it WRAPS -- stzNumber asks isNumber, stzString asks isString. stzList never asked isList, so comparing a stzList to a plain list said "different type", and IsStrictlyEqualTo() -- the conjunction of same type, same content and same order -- could never be true for the one comparison it exists to make.
1 examples runo1 = new stzList([ "a", "b", "c" ])
? o1.IsStrictlyEqualTo([ "a", "b", "c" ])
? o1.HasSameTypeAs([ "a", "b", "c" ])
? o1.HasSameContentAs([ "a", "b", "c" ])
? o1.HasSameSortingOrderAs([ "a", "b", "c" ])
#--> 1
#--> 1
#--> 1
#--> 1
library testno extension(no comment in the source: the name reads as a sentence) is not in lowercase 1 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsNotInLowercase()
#--> 0
composed from the signature, run for this page no extension IsInLowercase
(no comment in the source: the name reads as a sentence) is in lowercasein the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsInLowercase()
#--> 1
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) does not contain 1 examples runin the section essential methods for submodule supportno extension (no comment in the source: the name reads as a sentence) number of chars 1 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfChars()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU (no comment in the source: the name reads as a sentence) are included in 1 examples runin the section essential methods for submodule supporto1 = new stzList([ "green", "red" ])
# IsIncludedIn: the list is not itself one element of the host
? o1.IsIncludedIn([ "green", "red", "blue" ])
# AreIncludedIn: every item is present in the host
? o1.AreIncludedIn([ "green", "red", "blue" ])
#--> 0
#--> 1
library testno extension FindObjects([pcExpr]): 0-arg = positions of every object item; 1-arg = ItemsWhere(pcExpr).
2 examples runalso written: FindStzObjectso1 = new stzList([ Q("one"), Q(1), Q("two"), Q(2), Q("three"), Q(3), Q(1:2), NullObject() ])
? @@( o1.FindStzNumbers() )
? @@( o1.FindStzStrings() )
? @@( o1.FindStzLists() )
? @@( o1.FindStzObjects() )
#--> [ 2, 4, 6 ]
#--> [ 1, 3, 5 ]
#--> [ 7 ]
#--> [ 1, 2, 3, 4, 5, 6, 7, 8 ]library testQCSXTZZZIBWUToStzTable
The list turned into a stzTable object (rows; per the stzTable contract, the first row may carry the column names).no extension
TheseObjectsZ
(no comment in the source: the name reads as a sentence) these objects zin the section essential methods for submodule supportno extension
FindQObjects
(no comment in the source: the name reads as a sentence) find q objectsin the section essential methods for submodule supportno extension
FindNonStzObjects
(no comment in the source: the name reads as a sentence) find non stz objectsin the section essential methods for submodule supportno extension
ObjectsVarNames
(no comment in the source: the name reads as a sentence) objects var namesalso written: NamedObjectsin the section essential methods for submodule supportQCSXTZZZIBWU
NumberOfNamedObjects
(no comment in the source: the name reads as a sentence) number of named objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfNamedObjects()
#--> 0
composed from the signature, run for this page no extension NumberOfUnnamedObjects
(no comment in the source: the name reads as a sentence) number of unnamed objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfUnnamedObjects()
#--> 0
composed from the signature, run for this page no extension NumberOfObjects
(no comment in the source: the name reads as a sentence) number of objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfObjects()
#--> 0
composed from the signature, run for this page no extension NumberOfStzObjects
(no comment in the source: the name reads as a sentence) number of stz objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfStzObjects()
#--> 0
composed from the signature, run for this page no extension NumberOfQObjects
(no comment in the source: the name reads as a sentence) number of q objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfQObjects()
#--> 0
composed from the signature, run for this page no extension NumberOfNonStzObjects
(no comment in the source: the name reads as a sentence) number of non stz objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfNonStzObjects()
#--> 0
composed from the signature, run for this page no extension NumberOfUniqueNamedObjects
(no comment in the source: the name reads as a sentence) number of unique named objectsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfUniqueNamedObjects()
#--> 0
composed from the signature, run for this page no extension UnamedObjects
(no comment in the source: the name reads as a sentence) unamed objectsin the section essential methods for submodule supportno extension
StringsSplitted
(no comment in the source: the name reads as a sentence) strings splittedin the section essential methods for submodule supportcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.StringsSplitted(2) )
#--> [ [ "tea" ], [ "rice" ], [ "tea" ], [ "fish" ] ]
composed from the signature, run for this page no extension ObjectsAndTheirVarNames
(no comment in the source: the name reads as a sentence) objects and their var namesin the section essential methods for submodule supportno extension
FindUnnamedObjects
(no comment in the source: the name reads as a sentence) find unnamed objectsalso written: UnnamedObjectsin the section essential methods for submodule supportno extension
FindNamedObjects
(no comment in the source: the name reads as a sentence) find named objectsin the section essential methods for submodule supportno extension
FindObject
(no comment in the source: the name reads as a sentence) find objectin the section essential methods for submodule supportno extension
ObjectsAndTheirPositions
(no comment in the source: the name reads as a sentence) objects and their positionsin the section essential methods for submodule supportno extension
ItemsWhere
(no comment in the source: the name reads as a sentence) items wherein the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsWhere("@item > 3") )
#--> [ 5, 8 ]composed from the signature, run for this page no extension InsertAfterPositions
(no comment in the source: the name reads as a sentence) insert after positionsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.InsertAfterPositions([ 2, 3 ], 3)
? @@( o1.Content() )
#--> [ 5, 3, 3, 8, 3, 3, 1 ]
composed from the signature, run for this page no extension ReplaceItemsAtPositionsByMany
(no comment in the source: the name reads as a sentence) replace items at positions by manyin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceItemsAtPositionsByMany([ 1, 2 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ 2, 3, 8, 3, 1 ]
composed from the signature, run for this page no extension Same as IsContainedInCS: IsContainedIn(p): this list, taken as a single value, is an -- element of p (NOT element-wise -- that is AreContainedIn). (case-sensitive by default)
1 examples runo1 = new stzList([ "green", "red" ])
# IsIncludedIn: the list is not itself one element of the host
? o1.IsIncludedIn([ "green", "red", "blue" ])
# AreIncludedIn: every item is present in the host
? o1.AreIncludedIn([ "green", "red", "blue" ])
#--> 0
#--> 1
library testQCSXTZZZIBWUNumberOfLeadingItems
(no comment in the source: the name reads as a sentence) number of leading itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfLeadingItems()
#--> 1
composed from the signature, run for this page no extension NumberOfTrailingItems
(no comment in the source: the name reads as a sentence) number of trailing itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfTrailingItems()
#--> 1
composed from the signature, run for this page no extension ReplaceLeadingItems
(no comment in the source: the name reads as a sentence) replace leading itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceLeadingItems(3)
? @@( o1.Content() )
#--> [ 3, 3, 8, 3, 1 ]
composed from the signature, run for this page no extension ReplaceTrailingItems
(no comment in the source: the name reads as a sentence) replace trailing itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceTrailingItems(3)
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 3 ]
composed from the signature, run for this page no extension ReplaceLeadingAndTrailingItems
(no comment in the source: the name reads as a sentence) replace leading and trailing itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceLeadingAndTrailingItems(3)
? @@( o1.Content() )
#--> [ 3, 3, 8, 3, 3 ]
composed from the signature, run for this page no extension LeadingItems
(no comment in the source: the name reads as a sentence) leading itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.LeadingItems() )
#--> [ 5 ]
composed from the signature, run for this page no extension TrailingItems
(no comment in the source: the name reads as a sentence) trailing itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.TrailingItems() )
#--> [ 1 ]
composed from the signature, run for this page no extension HasLeadingItems
(no comment in the source: the name reads as a sentence) has leading itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasLeadingItems()
#--> 0
composed from the signature, run for this page no extension HasTrailingItems
(no comment in the source: the name reads as a sentence) has trailing itemsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasTrailingItems()
#--> 0
composed from the signature, run for this page no extension Combinations
(no comment in the source: the name reads as a sentence) combinationsin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Combinations() )
#--> [ [ 5, 3 ], [ 5, 8 ], [ 5, 3 ], [ 5, 1 ], [ 3, 8 ], [ 3, 3 ], [ 3, 1 ], [ 8, 3 ], [ 8, 1 ], [ 3, 1 ] ]
composed from the signature, run for this page no extension IsAtCharsNamedParam
(no comment in the source: the name reads as a sentence) is at chars named paramin the section essential methods for submodule supportno extension
(no comment in the source: the name reads as a sentence) is one of these named params 1 examples runin the section essential methods for submodule support? StzStringQ(:stzList).IsStzClassName()
? StzListQ( :ReturnedAs = :stzList ).IsOneOfTheseNamedParams([ :ReturnedAs, :ReturnAs ])
#--> 1
#--> 1
library testno extension IsStepNamedParam
(no comment in the source: the name reads as a sentence) is step named paramin the section essential methods for submodule supportno extension
IsIsBoundedByNamedParam
(no comment in the source: the name reads as a sentence) is is bounded by named paramin the section essential methods for submodule supportno extension
ItemsAndTheirNumberOfOccurrence
(no comment in the source: the name reads as a sentence) items and their number of occurrencein the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsAndTheirNumberOfOccurrence() )
#--> [ [ 5, 1 ], [ 3, 2 ], [ 8, 1 ], [ 1, 1 ] ]
composed from the signature, run for this page no extension SplitAround
(no comment in the source: the name reads as a sentence) split aroundin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplitAround(3) )
#--> [ [ 5 ], [ 8 ], [ 1 ] ]
composed from the signature, run for this page no extension TheseCharsZ
TheseCharsZ([chars]): each char grouped with ALL its positions in the list -- [ [c, [positions]], ... ].
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.TheseCharsZ([ 2, 3 ]) )
#--> [ [ 2, [ ] ], [ 3, [ 2, 4 ] ] ]
composed from the signature, run for this page no extensionNextNItemsAfter
(no comment in the source: the name reads as a sentence) next n items afterin the section essential methods for submodule supportno extension
Same as NumberOfOccurrenceCS: NumberOfOccurrenceCS: count occurrences How many times the given item occurs in the list.
8 examples runalso written: HowMany · NumberOfDuplicatesOfo1 = new stzList(1:14 + 12)
# numberofoccurrence example 1
? @@( o1.NumberOfOccurrence(12) )
#--> 2
library testQCSXTZZZIBWUSTNumberOfOccurrences
Same as NumberOfOccurrenceCS: NumberOfOccurrenceCS: count occurrences How many times the given item occurs in the list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfOccurrences(3)
#--> 2
composed from the signature, run for this page QCSXTZZZIBWUSame as NumberOfOccurrenceCS: NumberOfOccurrenceCS: count occurrences How many times the given item occurs in the list.
2 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Count(3)
#--> 2
composed from the signature, run for this page QCSXTZZZIBWUSTWFNthOccurrenceCS
Same as FindNthOccurrenceCS: FindNthOccurrenceCS: find nth occurrence
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NthOccurrenceCS(2, 3, TRUE)
#--> 4
composed from the signature, run for this page no extensionCase-insensitive word-order aliases used by narrative tests. (Cannot live inside FindNthOccurrenceCS as nested defs because they take a different arity -- top-level methods instead.)
7 examples runo1 = new stzList([ "_", "_", "♥", "_", "♥", "_", "_", "♥", "_", "_" ])
? o1.FindNth(3, "♥")
#--> 8
library testQCSXTZZZIBWUSame as FindNthOccurrenceCS: FindNthOccurrenceCS: find nth occurrence
1 examples runo1 = new stzList([ "_", "A", "_", "B", "C" ])
? o1.FindNthOccurrence(2, "_")
#--> 3
library testQCSXTZZZIBWUFindNumbersAsSections: scan content, return [[startPos,endPos],...] for each contiguous run of numeric items. Each section endpoint is a 1-based position in the original list. Single-number runs are returned as [pos, pos] (degenerate section).
2 examples runalso written: NumbersAsSectionso1 = new stzList([ 1, 2, 3, 4, "A", "B", 7, 8, "C", "D", 11, 12, 13 ])
? @@( o1.FindNumbersAsSections() )
#--> [ [ 1, 4 ], [ 7, 8 ], [ 11, 13 ] ]
library testno extensionSame as FindFirstOccurrenceCS: FindFirstOccurrenceCS / FindLastOccurrenceCS The position of the FIRST occurrence of the item (0 if none).
11 examples runo1 = new stzList([ "a", "ab", "abnA", "abAb" ])
? o1.Contains("n")
? o1.FindFirst("n")
#--> 0
#--> 0library testQCSXTZZZIBWUFindLastOccurrenceCS
(no comment in the source: the name reads as a sentence) find last occurrence csin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindLastOccurrenceCS(3, TRUE)
#--> 4
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) find last 7 examples runin the section essential methods for submodule supporto1 = new stzList([0, 0, 1, 0, 1])
? o1.FindLast(0)
#--> 4
library testQCSXTZZZIBWU Same as ContainsManyCS: ContainsManyCS: check if list contains multiple items
1 examples run# containsthese example 1
? @@( Q([ "a", "♥", "*" ]).ContainsThese([ "♥", "*"]) )
o1 = new stzList([ [ "a", "♥", "*" ], [ "♥", "*"], [ "a", "b", "♥", "*" ] ])
# containsthese example 2
? @@( o1.EachContainsThese([ "♥", "*" ]) )
#--> 1
#--> 1
library testQCSXTZZZIBWUSame as ContainsManyCS: ContainsManyCS: check if list contains multiple items
1 examples runalso written: ContainsEachOneOfTheseo1 = new stzList([ "1", "2", "A", "B", "C", "3", "4" ])
? o1.ContainsEach([ "A", "B", "C" ])
? o1.ContainsEachOneOfThese([ "A", "B", "C" ])
#--> 1
#--> 1
library testQCSXTZZZIBWUContainsAll
Same as ContainsManyCS: ContainsManyCS: check if list contains multiple items
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsAll([ 2, 3 ])
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUSame as RemoveAllCS: RemoveAllCS: remove all occurrences of an item
4 examples runoL = new stzList(aOrders)
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish", "rice", "soup", "rice" ]library testQCSXTZZZIBWUExceptFindW: find items matching a condition (eval-based) (case-sensitive by default)
3 examples runalso written: FindWhere · PositionsW · PositionsWhere · ItemsPositionsW · FindAllItemsWhereo1 = new stzList([ 2, 8, 2, 11, 2, 11, 1, 4, 2, 1, 3, 2, 10, 8, 3, 6, 8 ])
? o1.FindW( '{ Q( @NextItem ).IsDoubleOf( @PreviousItem ) }' )
? o1.FindWhere( '{ Q( This[@i+1] ).IsDoubleOf( This[@i-1] ) }' )
#--> 8
#--> 11
#--> 8
#--> 11library testQCSXTZZZIBWUFAllItemsWF
(no comment in the source: the name reads as a sentence) all items wfin the section essential methods for submodule supportno extension
CheckW: all items satisfy a W (DSL) condition. CheckW is the same -- now that the DSL is engine-backed (the perf/expressiveness split is gone).
4 examples runo1 = new stzList([ "A", "B", "C" ])
? o1.CheckW('{ isString(@item) and IsUppercase(@item) }')
#--> 1library testQCSXTZZZIBWUFAllItemsVerify
Same as AllItemsVerifyW: AllItemsVerifyW: readable alias of CheckW ("do ALL items verify ...?"). Haro's NULL is the empty string, but the W-engine doesn't know the NULL token, so '@item != NULL' is normalized to '@item != ""' first -- making the idiomatic non-null-string check work.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AllItemsVerify("@item > 3")
#--> 0composed from the signature, run for this page QCSXTZZZIBWUEachItemVerifiesW
Same as AllItemsVerifyW: AllItemsVerifyW: readable alias of CheckW ("do ALL items verify ...?"). Haro's NULL is the empty string, but the W-engine doesn't know the NULL token, so '@item != NULL' is normalized to '@item != ""' first -- making the idiomatic non-null-string check work.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.EachItemVerifiesW("@item > 3")
#--> 0composed from the signature, run for this page no extensionthe items at panPos all satisfy a W (DSL) condition
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CheckItemsAtW([ 2, 3 ], "@item > 3")
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUFSame as CheckItemsAtWF: WF variants: the items at panPos all satisfy an anonymous function
1 examples runo1 = new stzList([ "Word1", "كلمة 2", "Word3", "كلمة 4", "Word5", "كلمة 6" ])
? o1.CheckOnWF([1, 3, 5], func x { return Q(x).IsLeftToRight() } )
#--> 1library testno extensionCountUniqueItemsWF
(no comment in the source: the name reads as a sentence) count unique items wfin the section essential methods for submodule supportno extension
FindW: the extended (expressive) where-scan. Returns the matching -- POSITIONS (use ItemsW for the items at those positions). It accepts -- @NextItem/@PreviousItem/... and the Q(EXPR).Method(...) predicate form. -- ItemsAtPositions: get items at given positions
2 examples runalso written: ItemsAtaOrders = [ "tea", "rice", "tea", "fish", "rice", "tea", "soup", "tea", "rice" ]
? @@( StzListQ([ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]).FindW("@item % 3 = 1") )
? @@( StzListQ(aOrders).ItemsAtPositions([ 1, 4, 7 ]) )
#--> [ 1, 4, 7 ]
#--> [ "tea", "fish", "soup" ]library testQCSXTZZZIBWUExtendToPositionWith
Same as ExtendToPositionXT: ExtendToPositionXT: extend list to a given position
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.ExtendToPositionWith(2, 9)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSugar aliases over ExtendToPositionXT: the same operation but using the more natural "ExtendTo" / "Extend" naming. Default filler is the empty string.
4 examples runo1 = new stzList([ "A", "B", "C" ])
o1.ExtendTo(5)
? @@( o1.content() )
#--> [ "A", "B", "C", "", "" ]
library testQCSXTZZZIBWUSame as ExtendToPositionXT: ExtendToPositionXT: extend list to a given position
1 examples runo1 = new stzList("A" : "C")
o1.ExtendToWith(5, "*")
# extendtowith example 1
? @@( o1.Content() )
#--> [ "A", "B", "C", "*", "*" ]library testno extension(no comment in the source: the name reads as a sentence) difference with 1 examples runin the section essential methods for submodule supporto1 = new stzList([ "green", "red" ])
? @@( o1.DifferenceWith([ "b","x", "a", "f"]) ) # Or DifferentItemsWith()
? @@( o1.CommonItemsWith([ "b","x", "a", "f"]) ) # or Intersection()
? o1.ContainsSameItemsAs([ "red", "green" ])
? o1.ContainsSameItemsAs([ "a", "b", "c", "f" ])
#--> [ "green", "red", "b", "x", "a", "f" ]
#--> [ ]
#--> 1
#--> 0
library testQCSXTZZZIBWU Shrink: truncate the list to the first n items (in place).
1 examples runo1 = new stzList([ "A", "B", "C", "D", "E" ])
o1.ShrinkTo(3)
? o1.Content()
#--> A
#--> B
#--> C
library testQCSXTZZZIBWUTruncateTo
Same as ShrinkTo: Shrink: truncate the list to the first n items (in place).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.TruncateTo(2)
? @@( o1.Content() )
#--> [ 5, 3 ]
composed from the signature, run for this page no extensionKeepFirst
Same as ShrinkTo: Shrink: truncate the list to the first n items (in place).no extension
(no comment in the source: the name reads as a sentence) extend 6 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Extend(9)
? @@( o1.Content() )
#--> [ 5, 3, 8, 3, 1, 9 ]
composed from the signature, run for this page QCSXTZZZIBWU (no comment in the source: the name reads as a sentence) extend with 1 examples runin the section essential methods for submodule supporto1 = new stzList("A" : "C")
o1.ExtendWith(["D", "E"])
# extendwith example 1
? @@( o1.Content() )
#--> [ "A", "B", "C", "D", "E" ]library testno extension Min / Max for numeric lists
2 examples runalso named: smallest minimum lowest leastalso written: Lowest · Smallestcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Min()
#--> 1
composed from the signature, run for this page no extension(no comment in the source: the name reads as a sentence) max 2 examples runalso named: largest maximum highest biggest greatestalso written: Highest · Largest · Greatestin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Max()
#--> 8
composed from the signature, run for this page no extension Sum / Product / Mean (engine-backed)
1 examples runalso named: total add up aggregate sum of the numbers# Sum([1,2,3,4]) is 10
? Q([1,2,3,4]).Sum()
# IsEmpty([]) is TRUE
? Q([]).IsEmpty()
# IsEmpty([1]) is FALSE
? Q([1]).IsEmpty()
#--> 10
#--> 1
#--> 0
library testno extension(no comment in the source: the name reads as a sentence) product 1 examples runalso named: multiply all times all together multiplied productin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Product()
#--> 360
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) mean 1 examples runalso written: Averagein the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Mean()
#--> 4
composed from the signature, run for this page no extension Variance
FIXED 2026-07-25: Variance() here returned the POPULATION variance while stzDataSet returned the sample one, so the same data gave two answers depending on which class you held. The divisor now comes from one place in the engine (stats.varianceDivisor).
also named: spread dispersion sample variancecomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Variance()
#--> 7
composed from the signature, run for this page no extension(no comment in the source: the name reads as a sentence) variance sample 1 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.VarianceSample()
#--> 7
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) variance population 1 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.VariancePopulation()
#--> 5.60
composed from the signature, run for this page no extension Stddev
(no comment in the source: the name reads as a sentence) stddevalso written: StandardDeviationin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Stddev()
#--> 2.65
composed from the signature, run for this page no extension StddevSample
(no comment in the source: the name reads as a sentence) stddev samplealso written: StandardDeviationSamplein the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.StddevSample()
#--> 2.65
composed from the signature, run for this page no extension StddevPopulation
(no comment in the source: the name reads as a sentence) stddev populationalso written: StandardDeviationPopulationin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.StddevPopulation()
#--> 2.37
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) nth smallest 1 examples runin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NthSmallest(2)
#--> 3
composed from the signature, run for this page no extension NthLargest
(no comment in the source: the name reads as a sentence) nth largestin the section essential methods for submodule supportcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NthLargest(2)
#--> 5
composed from the signature, run for this page no extension Repeat
Repeat (engine-backed) Turn the content into n copies of the whole list, NESTED ([1,2] -> [[1,2],[1,2]]) -- mutating. For flat tiling, use the * operator.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Repeat(2)
? @@( o1.Content() )
#--> [ [ 5, 3, 8, 3, 1 ], [ 5, 3, 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWU(no comment in the source: the name reads as a sentence) repeated 1 examples runalso written: RepeatNTimes · RepeatedNTimesin the section essential methods for submodule support? @@NL( StzListQ([ 1, 2, 3 ]).RepeatNTimes(3) )
#--> [
#--> [ 1, 2, 3 ],
#--> [ 1, 2, 3 ],
#--> [ 1, 2, 3 ]
#--> ...
library testno extension SplitAt
SplitAt (engine-backed) Split the list at the given cut position(s): the parts.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplitAt(2) )
#--> [ [ 5 ], [ 3, 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWURanked
Ranked (engine-backed) The rank of each item in the sorted order, as a list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Ranked() )
#--> [ 4, 2, 5, 2, 1 ]
composed from the signature, run for this page no extensionJoin
Join (engine-backed) The items joined into one string with the given separator.
also named: concatenate glue together merge into one stringalso written: Joinedcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Join(" ")
#--> 5 3 8 3 1composed from the signature, run for this page no extensionIsListOfHashLists
additional type checking methods
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfHashLists()
#--> 0
composed from the signature, run for this page no extensionadditional type checking methods
1 examples runo1 = new stzList([ "a", "b", "c", "a", "a", "b", "c" ])
? o1.IsMadeOf([ "a", "b", "c" ])
? o1.IsMadeOfSome([ "a", "b", "c", "x", "z" ])
#--> 1
#--> 1
library testno extensionIsPairOfStrings
additional type checking methods
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsPairOfStrings()
#--> 0
composed from the signature, run for this page no extensionSame as AntiFindCS: The positions of the items DIFFERENT from the given item.
1 examples runo1 = new stzList([ "1", "2", "♥", "4", "5", "♥", "6", "7", "♥", "9" ])
? @@( o1.Find("♥") ) + NL
? @@( o1.AntiFind("♥") ) + NL
#--> [ 3, 6, 9 ]
#--> [ 1, 2, 4, 5, 7, 8, 10 ]library testQCSXTZZZIBWUAntiFindAsSections
Same as AntiFindAsSectionsCS: The [start, end] sections of the runs of items DIFFERENT from the given item.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.AntiFindAsSections(3) )
#--> [ [ 1, 1 ], [ 3, 3 ], [ 5, 5 ] ]
composed from the signature, run for this page QCSXTZZZIBWUgetting the anti-positions of the given positions in the list
1 examples runo1 = new stzList(1:10)
? o1.AntiPositions([ 3, 4, 7, 9 ])
#--> 1
#--> 2
#--> 5
#--> 6
#--> ...
library testQCSXTZZZIBWUFindNOccurrences
The positions of the first n occurrences of the given item.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNOccurrences(2, 3) )
#--> [ 2, 4 ]
composed from the signature, run for this page QCSXTZZZIBWUFindGivenOccurrences
Same as FindGivenOccurrencesCS: FindFirstCS/FindFirst/FindLastCS/FindLast already defined above as aliasesQCSXTZZZIBWU
FindAllExceptFirst
The positions of every occurrence of the item EXCEPT the first.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindAllExceptFirst(3) )
#--> [ 4 ]
composed from the signature, run for this page QCSXTZZZIBWUFindAllExceptLast
The positions of every occurrence of the item EXCEPT the last.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindAllExceptLast(3) )
#--> [ 2 ]
composed from the signature, run for this page QCSXTZZZIBWUThe position of the nth occurrence of the item AFTER the given position (0 when there is none).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextNthOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUFindNextOccurrence
The position of the next occurrence of the item after the given position (0 when there is none).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextOccurrence(3, 2)
#--> 4
composed from the signature, run for this page QCSXTZZZIBWUFindNext: convenience wrapper used by narrative tests. Accepts either FindNext(item, n) or FindNext(item, :StartingAt = n).
6 examples runo1 = new stzList([ 1, 2, 3, "*", 5, 6, "*", 8, 9 ])
# findnext example 1
? @@( o1.FindNext("*", :StartingAt = 4) )
#--> 7library testQCSXTZZZIBWUSTThe position of the nearest occurrence of the item BEFORE the given position (0 when there is none).
4 examples runo1 = new stzList([ "1", "2", "♥", "4", "♥", "6", "7" ])
? o1.FindPrevious("♥", :StartingAt = 5)
? o1.FindNthPrevious(2, "♥", :StartingAt = 6)
#--> 3
#--> 3library testQCSXTZZZIBWUSTFindNthPrevious(n, pItem, pnStartingAt): word-order alias over FindPreviousNthOccurrence -- find the Nth occurrence of pItem walking backwards from pnStartingAt. Accepts :StartingAt = n.
5 examples runo1 = new stzList([ 1, 2, 3, "A":"C", 5, 7, 8, 9, "A":"C" ])
? o1.FindNthPrevious(2, "A":"C", :StartingAt = 7)
#--> 0
library testQCSXTZZZIBWUFindNthNext(n, pItem, pnStartingAt): symmetric forward variant.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNthNext(2, 3, 5)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUThe position of the nth occurrence of the item BEFORE the given position (0 when there is none).
1 examples runo1 = new stzList([ "mio", "mix", "mia", "mio", "mix", "miz", "mix" ])
? o1.FindPreviousNthOccurrence( 2, :Of = "mix", :StartingAt = 6)
#--> 2
library testQCSXTZZZIBWUFindPreviousOccurrence
The position of the nearest occurrence of the item before the given position (0 when there is none).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindPreviousOccurrence(3, 2)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUMissing name-variants for the next/previous occurrence family -- (delegating to stzListFinder; strictly-after / strictly-before).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNthNextOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page no extensionThe position of the nth occurrence of the item after the given position.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextNth(2, 3, 5)
#--> 0
composed from the signature, run for this page no extensionThe positions of ALL the occurrences after the given position.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNextOccurrences(3, 2) )
#--> [ 4 ]
composed from the signature, run for this page QCSXTZZZIBWUSTthe listed nths (forward index) after / before a position
1 examples runo1 = new stzList([ "A" , "B", "A", "C", "A", "D", "A" ])
# FindNextOccurrencesST('A', 3) -> positions of A after 3
? @@( o1.FindNextOccurrencesST("A", 3) )
# FindNextNthOccurrencesST([1,2], 'A', 3) picks the 1st and 2nd of those
? @@( o1.FindNextNthOccurrencesST([1, 2], "A", 3) )
#--> [ 5, 7 ]
#--> [ 5, 7 ]library testno extensionFindPreviousOccurrences
The positions of ALL the occurrences before the given position.QCSXTZZZIBWUST
FindPreviousNthOccurrences
next / previous occurrence search (from a position)QCSXTZZZIBWU
FindFirstNext
The position of the first occurrence after the given position.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindFirstNext(3, 2)
#--> 4
composed from the signature, run for this page no extensionFindFirstPrevious
The position of the first occurrence before the given position (scanning backward).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindFirstPrevious(3, 2)
#--> 0
composed from the signature, run for this page no extensionThe positions of every occurrence of the item (the Find contract).
1 examples runalso named: index of position of locate where is at what indexcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindItem(3) )
#--> [ 2, 4 ]
composed from the signature, run for this page no extensionThe position of the nth occurrence before the given position.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindPreviousNth(2, 3, 5)
#--> 2
composed from the signature, run for this page no extensionThe position of the nth occurrence after the given position.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NthNextOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page no extensionThe position of the nth occurrence after the given position.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NextNthOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page no extensionsmallest/largest positions, items-with-positions, etc.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindSmallest() )
#--> [ 5 ]
composed from the signature, run for this page no extensionsmallest/largest positions, items-with-positions, etc.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfSmallest()
#--> 1
composed from the signature, run for this page no extensionsmallest/largest positions, items-with-positions, etc.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfOccurrencesOfSmallestItem()
#--> 1
composed from the signature, run for this page no extensionsmallest/largest positions, items-with-positions, etc.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindLargest() )
#--> [ 3 ]
composed from the signature, run for this page no extensionNumberOfLargest
smallest/largest positions, items-with-positions, etc.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfLargest()
#--> 1
composed from the signature, run for this page no extensionNumberOfOccurrencesOfLargestItem
smallest/largest positions, items-with-positions, etc.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfOccurrencesOfLargestItem()
#--> 1
composed from the signature, run for this page no extension[[item, [positions...]], ...] in first-appearance order
6 examples runalso written: Index · ItemsAndTheirPositionso1 = new stzList([ "A", "B", "A", "C", "D", "B" ])
? @@( o1.Index() )
#--> [ [ "A", [ 1, 3 ] ], [ "B", [ 2, 6 ] ], [ "C", [ 4 ] ], [ "D", [ 5 ] ] ]
library testQCSXTZZZIBWUWF[[item, count], ...] in first-appearance order (type-sensitive)
1 examples runo1 = new stzList([ "1", "A", "B", "A", "A", "C", "B", 1 ])
? @@( o1.Withoutduplication() ) + NL
? @@( o1.FindItems() ) + NL # Or ItemsZ()
? @@( o1.ItemsCount() )
#--> [ "1", "A", "B", "C", 1 ]
#--> [ [ "1", [ 1 ] ], [ "A", [ 2, 4, 5 ] ], [ "B", [ 3, 7 ] ], [ "C", [ 6 ] ], [ 1, [ 8 ] ] ]
#--> [ [ "1", 1 ], [ "A", 3 ], [ "B", 2 ], [ "C", 1 ], [ 1, 1 ] ]
library testno extensionThe positions of the items that repeat consecutively.
1 examples runQCSXTZZZIBWUThe items that repeat in consecutive runs (dup-secutive: duplicated AND consecutive). (case-sensitive by default)
1 examples runQCSXTZZZIBWUThe positions where the GIVEN item repeats consecutively.
1 examples runQCSXTZZZIBWUThe consecutive-duplicate run of the given item, along with its positions.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DupSecutiveItemCSZ(3, TRUE) )
#--> [ 3, [ ] ]
composed from the signature, run for this page no extensionDupSecutiveItemZ
Same as DupSecutiveItemCSZ: The consecutive-duplicate run of the given item, along with its positions.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DupSecutiveItemZ(3) )
#--> [ 3, [ ] ]
composed from the signature, run for this page no extensionRemoveDupSecutiveItems
Same as RemoveDupSecutiveItemsCS: Collapse every consecutive-duplicate run to a single item (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveDupSecutiveItems()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUSame as RemoveDupSecutiveItemCS: Collapse the consecutive-duplicate runs of the GIVEN item (mutating).
1 examples runcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveDupSecutiveItem(3)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUThe position(s) of the nth smallest item.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNthSmallest(2) )
#--> [ 2, 4 ]
composed from the signature, run for this page no extensionFindNthLargest
The position(s) of the nth largest item.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNthLargest(2) )
#--> [ 1 ]
composed from the signature, run for this page no extensioncontiguous runs of strings / lists as [start,end] sections
1 examples runalso written: FindStringsZZcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.FindStringsAsSections() )
#--> [ [ 1, 4 ] ]
composed from the signature, run for this page no extensionThe [start, end] runs of consecutive LIST items.
1 examples runalso written: FindListsZZno extensionFindObjectsAsSections
The [start, end] runs of consecutive OBJECT items.no extension
first position type-sensitively equal to pItem ("2" != 2 != [2])
1 examples run? StzListQ([ 3, 2, 5 ]).FindFirstOccurrence("2")
? StzListQ([ 3, 2, 5 ]).FindFirstOccurrence([ 2 ])
? StzListQ([ 3, 2, 5 ]).FindFirstOccurrence( 2 )
? Q(2).IsOneOfThese([ 3, 2, 5 ])
? Q("2").IsOneOfThese([ 3, 2, 5 ])
? Q([2]).IsOneOfThese([ 3, 2, 5 ])
#--> 0
#--> 0
#--> 2
#--> 1
#--> ...library testQCSXTZZZIBWUFindItemsOtherThan
Same as FindAllExcept: positions of items NOT in paItems
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindItemsOtherThan([ 2, 3 ]) )
#--> [ 1, 3, 5 ]
composed from the signature, run for this page no extensionSame as RemoveAllCS: RemoveAllCS: remove all occurrences of an item
2 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Remove(3)
? @@( o1.Content() )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWFManyRemoveTheseItems
(no comment in the source: the name reads as a sentence) remove these itemsin the section remove family (occurrences / except / runs / dups)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveTheseItems([ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extension RemoveItemsOtherThan
Same as RemoveAllExcept: keep only items that are members of paItems (drop everything else)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveItemsOtherThan([ 2, 3 ])
? @@( o1.Content() )
#--> [ 3, 3 ]
composed from the signature, run for this page no extensionremove the panOcc-th occurrences of pItem (by occurrence index)
1 examples runo1 = new stzList([ "a", "b", "a", "a", "c", "d", "a" ])
o1.RemoveOccurrences([ 4, 1, 3 ], "a")
? o1.Content()
#--> b
#--> a
#--> c
#--> d
library testno extension(no comment in the source: the name reads as a sentence) remove any item from start 1 examples runin the section remove family (occurrences / except / runs / dups)o1 = new stzList([ "🔻", "🔻", "1", "2", "3", "🔻", "🔻" ])
o1.RemoveAnyItemFromStart("🔻")
? @@( o1.Content() )
o1.RemoveAnyItemFromEnd("🔻")
? @@( o1.Content() )
#--> [ "1", "2", "3", "🔻", "🔻" ]
#--> [ "1", "2", "3" ]library testno extension (no comment in the source: the name reads as a sentence) remove any item from end 1 examples runin the section remove family (occurrences / except / runs / dups)o1 = new stzList([ "🔻", "🔻", "1", "2", "3", "🔻", "🔻" ])
o1.RemoveAnyItemFromStart("🔻")
? @@( o1.Content() )
o1.RemoveAnyItemFromEnd("🔻")
? @@( o1.Content() )
#--> [ "1", "2", "3", "🔻", "🔻" ]
#--> [ "1", "2", "3" ]library testno extension (no comment in the source: the name reads as a sentence) remove non duplicates 1 examples runin the section remove family (occurrences / except / runs / dups)o1 = new stzList([ "A", "B", "2", "A", "A", "B", 2, 2, "." ])
o1.RemoveNonDuplicates()
# removenonduplicates example 1
? @@( o1.Content() )
#--> [ "A", "B", "A", "A", "B", 2, 2 ]
library testno extension remove the n-th occurrence of pItem
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveThisNthItem(2, 3)
? @@( o1.Content() )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page no extensionSame as RemoveThisNthItem: remove the n-th occurrence of pItem
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveNth(2, 3)
? @@( o1.Content() )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page no extensionRemoveNextNthOccurrence
occurrence removal relative to a position (Next strictly after, -- Previous strictly before; the Nth index is forward into that run)
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveNextNthOccurrence(2, 3, 5)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionRemoveNextNthOccurrences
(no comment in the source: the name reads as a sentence) remove next nth occurrencesin the section remove family (occurrences / except / runs / dups)composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveNextNthOccurrences([ 2, 3 ], 3, 2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extension NextNthOccurrencesRemoved
(no comment in the source: the name reads as a sentence) next nth occurrences removedin the section remove family (occurrences / except / runs / dups)composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.NextNthOccurrencesRemoved([ 2, 3 ], 3, 2) )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extension RemovePreviousNthOccurrence
(no comment in the source: the name reads as a sentence) remove previous nth occurrencein the section remove family (occurrences / except / runs / dups)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemovePreviousNthOccurrence(2, 3, 5)
? @@( o1.Content() )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page no extension RemovePreviousNthOccurrences
(no comment in the source: the name reads as a sentence) remove previous nth occurrencesin the section remove family (occurrences / except / runs / dups)composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemovePreviousNthOccurrences([ 2, 3 ], 3, 2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extension PreviousNthOccurrencesRemoved
(no comment in the source: the name reads as a sentence) previous nth occurrences removedin the section remove family (occurrences / except / runs / dups)composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.PreviousNthOccurrencesRemoved([ 2, 3 ], 3, 2) )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extension remove the first occurrence of pItem
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveFirst(3)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionSame as RemoveFirst: remove the first occurrence of pItem
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveThisFirstItem(3)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUremove the item at position n; accepts :First / :Last
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveNthItem(2)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page no extension(no comment in the source: the name reads as a sentence) contains no 3 examples runin the section contains predicates (no / both / each / only-one / by-type)o1 = new stzList([ "A", "B", "C" ])
? o1.ContainsNo("v")
? o1.ContainsNoObjects()
#--> 1
#--> 1library testno extension ContainsBoth
(no comment in the source: the name reads as a sentence) contains bothin the section contains predicates (no / both / each / only-one / by-type)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsBoth(3, 4)
#--> 0
composed from the signature, run for this page no extension TRUE iff exactly ONE distinct member of paItems is present
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsOnlyOneOfThese([ 2, 3 ])
#--> 1
composed from the signature, run for this page no extension(no comment in the source: the name reads as a sentence) contains no objects 2 examples runin the section contains predicates (no / both / each / only-one / by-type)o1 = new stzList([ "A", "B", "C" ])
? o1.ContainsNo("v")
? o1.ContainsNoObjects()
#--> 1
#--> 1library testno extension ContainsObjects
(no comment in the source: the name reads as a sentence) contains objectsin the section contains predicates (no / both / each / only-one / by-type)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsObjects()
#--> 0
composed from the signature, run for this page no extension ContainsOneOrMoreLists
(no comment in the source: the name reads as a sentence) contains one or more listsalso written: ContainsListsin the section contains predicates (no / both / each / only-one / by-type)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsOneOrMoreLists()
#--> 0
composed from the signature, run for this page no extension ContainsNoNumbers
(no comment in the source: the name reads as a sentence) contains no numbersin the section contains predicates (no / both / each / only-one / by-type)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNoNumbers()
#--> 0
composed from the signature, run for this page no extension ContainsNoStrings
(no comment in the source: the name reads as a sentence) contains no stringsin the section contains predicates (no / both / each / only-one / by-type)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNoStrings()
#--> 1
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) is single 1 examples runin the section singles (1-elem lists) and pairs (2-elem lists)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsSingle()
#--> 0
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) find singles 1 examples runin the section singles (1-elem lists) and pairs (2-elem lists)no extension (no comment in the source: the name reads as a sentence) singles 1 examples runin the section singles (1-elem lists) and pairs (2-elem lists)QCSXTZZZIBWU (no comment in the source: the name reads as a sentence) contains singles 1 examples runin the section singles (1-elem lists) and pairs (2-elem lists)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsSingles()
#--> 0
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) singlified 1 examples runin the section singles (1-elem lists) and pairs (2-elem lists)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Singlified() )
#--> [ [ 5 ], [ 3 ], [ 8 ], [ 3 ], [ 1 ] ]
composed from the signature, run for this page no extension FindPairs
(no comment in the source: the name reads as a sentence) find pairsin the section singles (1-elem lists) and pairs (2-elem lists)no extension
ItemsThatArePairs
(no comment in the source: the name reads as a sentence) items that are pairsin the section singles (1-elem lists) and pairs (2-elem lists)no extension
ContainsPairs
(no comment in the source: the name reads as a sentence) contains pairsin the section singles (1-elem lists) and pairs (2-elem lists)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsPairs()
#--> 0
composed from the signature, run for this page no extension Pairified
(no comment in the source: the name reads as a sentence) pairifiedin the section singles (1-elem lists) and pairs (2-elem lists)composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Pairified() )
#--> [ [ 5, "" ], [ 3, "" ], [ 8, "" ], [ 3, "" ], [ 1, "" ] ]
composed from the signature, run for this page no extension [[item,[positions]],...] for each given item (includes empties)
2 examples runo1 = new stzList([ :one, :two, :one, :three, :one, :four ])
? o1.FindMany([ :one, :five ])
? @@(o1.TheseItemsZ([ :one, :five ]))
#--> 1
#--> 3
#--> 5
#--> [ [ "one", [ 1, 3, 5 ] ], [ "five", [ ] ] ]
library testno extensiondistinct items by occurrence count (>= n by default)
2 examples runalso written: ItemsOccuringNTimes · ItemsOccurringNTimesOrMorecomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsOccurringNTimes(2) )
#--> [ 3 ]
composed from the signature, run for this page QCSXTZZZIBWU(no comment in the source: the name reads as a sentence) items occurring exactly n times 1 examples runalso written: ItemsOccuringExactlyNTimesin the section items / these-items familycomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsOccurringExactlyNTimes(2) )
#--> [ 3 ]
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) items occurring less than n times 1 examples runin the section items / these-items familycomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsOccurringLessThanNTimes(2) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extension (no comment in the source: the name reads as a sentence) items occurring n times or less 1 examples runin the section items / these-items familycomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsOccurringNTimesOrLess(2) )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page no extension ItemsOccurringMoreThanNTimes
(no comment in the source: the name reads as a sentence) items occurring more than n timesin the section items / these-items familyno extension
(no comment in the source: the name reads as a sentence) items have same type 1 examples runalso written: AllItemsHaveSameTypein the section items / these-items familyoList = new stzList([ [1],[1],[1],[1] ])
? oList.ItemsHaveSameType()
? oList.ItemsAreEmptyLists()
#--> 1
#--> 0
library testno extension (no comment in the source: the name reads as a sentence) items are empty lists 1 examples runin the section items / these-items familyoList = new stzList([ [1],[1],[1],[1] ])
? oList.ItemsHaveSameType()
? oList.ItemsAreEmptyLists()
#--> 1
#--> 0
library testno extension IsMadeOfItem -> every item equals the given one.
2 examples runalso written: IsMadeOfItem · IsMadeOfThisItemin the section items / these-items familyo1 = new stzList([ "a", "a", "A", "A", "a", "A" ])
? o1.ItemsAreEqualTo("a")
? o1.ItemsAreEqualToCS("a", FALSE)
? o1.ContainsOnly("a")
? o1.ContainsOnlyCS("A", FALSE)
#--> 0
#--> 1
#--> 0
#--> 1library testQCSXTZZZIBWUItemsHaveXT
all items satisfy a W-condition
also written: AllItemsHaveXTcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ItemsHaveXT("@item > 3")
#--> 0composed from the signature, run for this page no extensioninsert after/before many positions / by w-condition
1 examples runo1 = new stzList([ "a", "b", "c", "d", "e" ])
o1.InsertAfterManyPositions([ 2, 4, 5 ], "*")
? @@( o1.Content() )
#--> [ "a", "b", "*", "c", "d", "*", "e", "*" ]
library testno extensioninsert after/before many positions / by w-condition
1 examples runo1 = new stzList([ "a", "b", "c", "d", "e" ])
o1.InsertBeforeManyPositions([ 2, 4, 5 ], "*")
? @@( o1.Content() )
#--> [ "a", "*", "b", "c", "*", "d", "*", "e" ]
library testno extensionNumberOfUniqueItemsW
How many unique items satisfy the given W condition.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfUniqueItemsW("@item > 3")
#--> 2composed from the signature, run for this page QCSXTZZZIBWUFSplitXT
SplitAt already defined in coreno extension
SplittedXT
Split with the given item-or-options param; the parts, as data.no extension
SplitAsSectionsXT
Split with the given item-or-options param; the [start, end] sections of the parts.no extension
SplittedAsSectionsXT
The [start, end] sections of the parts, as data (XT options form).no extension
SplitCS
Split the list at the given item (or position): the parts.no extension
SplitAtPositions
SplitAtPositions MUTATES the content into the list of parts; the items AT the positions are DROPPED (split "at", not "before").
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplitAtPositions([ 2, 3 ]) )
#--> [ [ 5 ], [ 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUSplittedAtPositions
The parts of the list split at the given positions.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedAtPositions([ 2, 3 ]) )
#--> [ [ 5 ], [ 3 ], [ 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUSplitAtPosition
Split the list at the given position: the parts.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.SplitAtPosition(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUSplittedAtPosition
The parts of the list split at the given position.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedAtPosition(2) )
#--> [ [ 5 ], [ 3, 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUSplittedAt
The parts of the list split at each occurrence of the given item (the item itself is not kept in the parts).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedAt(3) )
#--> [ [ 5, 3 ], [ 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUSplitBeforePosition
Split the list before the given position: the parts.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.SplitBeforePosition(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSplittedBeforePosition
The parts of the list split before the given position.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedBeforePosition(2) )
#--> [ [ 5 ], [ 3, 8, 3, 1 ] ]
composed from the signature, run for this page no extensionSplitBefore
Split the list before each occurrence of the item: each occurrence starts a new part.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.SplitBefore(3)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUSplitAfterPosition
Split the list after the given position: the parts.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.SplitAfterPosition(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSplittedAfterPosition
The parts of the list split after the given position.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedAfterPosition(2) )
#--> [ [ 5, 3 ], [ 8, 3, 1 ] ]
composed from the signature, run for this page no extensionSplitAfter
Split the list after each occurrence of the item: each occurrence closes its part.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.SplitAfter(3)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUSplit the list into n (near-)equal parts.
1 examples runalso named: divide chunk break into parts portionso1 = new stzSplitter(3)
? @@( o1.SplitToNParts(0) )
o1 = new stzList([ "A", "B", "C" ])
? @@( o1.SplittedToNParts(3) )
#--> [ ]
#--> [ [ "A" ], [ "B" ], [ "C" ] ]
library testQCSXTZZZIBWUThe n (near-)equal parts of the list, as data.
3 examples runo1 = new stzList(["one", "two", "three", "four", "five", "six" ])
? @@( o1.SplittedToPartsOfNItems(3) ) + NL
? @@( o1.SplittedToNParts(3) )
#--> [ [ "one", "two", "three" ], [ "four", "five", "six" ] ]
#--> [ [ "one", "two" ], [ "three", "four" ], [ "five", "six" ] ]
library testno extensionSplitToPartsOfNItems
Split the list into parts of n items each.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SplitToPartsOfNItems(2)
? @@( o1.Content() )
#--> [ [ 5, 3 ], [ 8, 3 ], [ 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUSplitToPartsOf
Same as SplitToPartsOfNItems: Split the list into parts of n items each.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SplitToPartsOf(2)
? @@( o1.Content() )
#--> [ [ 5, 3 ], [ 8, 3 ], [ 1 ] ]
composed from the signature, run for this page no extensionsplitting to parts of n items
2 examples runalso written: SplittedToPartsOfo1 = new stzList(["one", "two", "three", "four", "five", "six" ])
? @@( o1.SplittedToPartsOfNItems(3) ) + NL
? @@( o1.SplittedToNParts(3) )
#--> [ [ "one", "two", "three" ], [ "four", "five", "six" ] ]
#--> [ [ "one", "two" ], [ "three", "four" ], [ "five", "six" ] ]
library testQCSXTZZZIBWUSplitAtPacer
splitting using a given pacer
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.SplitAtPacer(2, 5)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSplittedAtPacer
splitting using a given pacer
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedAtPacer(2, 5) )
#--> [ [ 5, 3, 8, 3 ], [ 1 ] ]
composed from the signature, run for this page no extensionSplitW
SplitW MUTATES the content into the list of parts (the matching items are dropped; SplittedW is the passive twin).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplitW("@item > 3") )
#--> [ [ 3 ], [ 3, 1 ] ]composed from the signature, run for this page no extensionSplittedW
splitting using a condition
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SplittedW("@item > 3") )
#--> [ [ 5, 3 ], [ 8, 3, 1 ] ]composed from the signature, run for this page no extensionHasRepeatedLeadingItems
Same as HasRepeatedLeadingItemsCS: TRUE if the list starts with a repeated run of the same item.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasRepeatedLeadingItems()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWURepeatedLeadingItems
Same as RepeatedLeadingItemsCS: The repeated run at the START of the list, as a list.QCSXTZZZIBWU
RepeatedLeadingItem
Same as RepeatedLeadingItemCS: The item repeated at the start of the list.QCSXTZZZIBWU
NumberOfRepeatedLeadingItems
Same as NumberOfRepeatedLeadingItemsCS: How long the repeated run at the start of the list is.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfRepeatedLeadingItems()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUHasRepeatedTrailingItems
Same as HasRepeatedTrailingItemsCS: TRUE if the list ends with a repeated run of the same item.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasRepeatedTrailingItems()
#--> 0
composed from the signature, run for this page QCSXTZZZIBWURepeatedTrailingItems
Same as RepeatedTrailingItemsCS: The repeated run at the END of the list, as a list.QCSXTZZZIBWU
RepeatedTrailingItem
Same as RepeatedTrailingItemCS: The item repeated at the end of the list.QCSXTZZZIBWU
NumberOfRepeatedTrailingItems
Same as NumberOfRepeatedTrailingItemsCS: How long the repeated run at the end of the list is.QCSXTZZZIBWU
Pop
Remove the LAST item and return it.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Pop()
#--> 1
composed from the signature, run for this page no extensionPopFirst
Remove the FIRST item and return it.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.PopFirst()
#--> 5
composed from the signature, run for this page no extensionTake
Remove the first n items and return them.
also named: pop first items grab draw from the frontcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Take(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page no extensionTakeLast
Remove the last n items and return them.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.TakeLast(2) )
#--> [ 3, 1 ]
composed from the signature, run for this page no extensionSame as TrimCS: Remove the runs of EMPTY items (0, empty string, empty sublist, false-object -- the monolith semantics) from BOTH ends; a fully-empty list keeps one item (mutating).
1 examples runo1 = new stzList([ 0, "", [], 1, 2, 3, [], NULL, 0 ])
o1.Trim()
? @@( o1.Content() )
#--> [ 1, 2, 3 ]
library testQCSXTZZZIBWUTrimmed
Same as TrimmedCS: A copy with the empty boundary runs trimmed; the original is unchanged.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Trimmed() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUSame as TrimLeftCS: Remove the leading run of empty items (0, empty string, empty sublist, false-object) -- mutating.
1 examples runo1 = new stzList([ 0, "", [], 1, 2, 3, [], NULL, 0 ])
o1.TrimLeft()
o1.TrimRight()
? @@( o1.Content() )
#--> [ 1, 2, 3 ]
library testQCSXTZZZIBWUTrimmedLeft
Same as TrimmedCS: A copy with the empty boundary runs trimmed; the original is unchanged.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.TrimmedLeft() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSame as TrimRightCS: Remove the trailing run of empty items (mutating).
1 examples runo1 = new stzList([ 0, "", [], 1, 2, 3, [], NULL, 0 ])
o1.TrimLeft()
o1.TrimRight()
? @@( o1.Content() )
#--> [ 1, 2, 3 ]
library testQCSXTZZZIBWUTrimmedRight
A copy with the trailing empty run trimmed; the original is unchanged.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.TrimmedRight() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionTrimItem
Same as TrimItemCS: Remove the runs of the given item from BOTH ends (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.TrimItem(3)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUTrimItemFromLeft
Same as TrimItemFromLeftCS: Remove the run of the given item from the START (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.TrimItemFromLeft(3)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUTrimItemFromRight
Same as TrimItemFromRightCS: Remove the run of the given item from the END (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.TrimItemFromRight(3)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUCompact
Remove the blank strings (whitespace-only) and empty sublists throughout the list (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.Compact()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionCompacted
compact (remove all empty items)
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Compacted() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSqueeze
Collapse each consecutive run of blank strings to a single one (mutating).no extension
Squeezed
squeeze (remove consecutive duplicate empty items)
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Squeezed() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionStripNulls
Remove the null items from the list (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.StripNulls()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionNullsStripped
strip nulls (remove nulls and empty strings)
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.NullsStripped() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionTrimToSize
Cut the list down to its first n items (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.TrimToSize(2)
? @@( o1.Content() )
#--> [ 5, 3 ]
composed from the signature, run for this page no extensionTrimmedToSize
trim to size (keep only first n items)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.TrimmedToSize(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page no extensionSame as UniqueItemsCS: The unique items of the list, in first-seen order.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.UniqueItems() )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWFRandomItem
One item picked at random.QCSXTZZZIBWUExcept
NRandomItems
n items picked at random.also written: rndNItems · RandomNItemsno extension
rndItems
The items of the list, in random order.also written: RandomItemsno extension
rndRemoveNItems
Remove n randomly-chosen items (mutating).also written: RandomRemoveNItemsQCSXTZZZIBWU
rndRemoveItems
Remove randomly-chosen items (mutating).also written: RandomRemoveItemsQCSXTZZZIBWU
ItemsBetween
items between two positions
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsBetween(2, 5) )
#--> [ 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionEveryNthItem
Every nth item of the list (n, 2n, 3n, ...).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.EveryNthItem(2) )
#--> [ 3, 3 ]
composed from the signature, run for this page no extensionHead
The first n items of the list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Head(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page no extensionTail
The last n items of the list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Tail(2) )
#--> [ 3, 1 ]
composed from the signature, run for this page no extensionOnlyStrings
Only the STRING items of the list.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.OnlyStrings() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUOnly the NUMBER items of the list.
1 examples runo1 = new stzList( 1:7 + "str1" + "str2" + [ "+", "-" ] )
# onlynumbers example 1
? @@( o1.OnlyNumbers() )
#--> [ 1, 2, 3, 4, 5, 6, 7 ]
library testQCSXTZZZIBWUOnlyLists
Only the LIST items of the list.QCSXTZZZIBWU
OnlyChars
Only the CHAR items of the list.QCSXTZZZIBWU
Pairs
Pairs(): the items of the list that are themselves pairs (2-element -- lists). For the sliding/consecutive grouping use Pairify()/ToPairs().QCSXTZZZIBWU
Pairify
Pairify()/ToPairs(): group the list into consecutive (sliding) pairs, -- e.g. [1,2,3,4] -> [[1,2],[2,3],[3,4]].
also written: ToPairscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Pairify() )
#--> [ [ 5, 3 ], [ 3, 8 ], [ 8, 3 ], [ 3, 1 ] ]
composed from the signature, run for this page no extensionTriplets
pairs / triplets / windows
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Triplets() )
#--> [ [ 5, 3, 8 ], [ 3, 8, 3 ], [ 8, 3, 1 ] ]
composed from the signature, run for this page no extensionSlidingWindow
pairs / triplets / windows
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SlidingWindow(2) )
#--> [ [ 5, 3 ], [ 3, 8 ], [ 8, 3 ], [ 3, 1 ] ]
composed from the signature, run for this page no extensionAddWalker
AddWalker: register a NAMED walker over this list. The 4 args may be -- given positionally (name, start, end, step) OR as named pairs / -- function-style helpers in any order: -- AddWalker(:Named=:W, :StartingAt=1, :EndingAt=10, :NStep=2) -- AddWalker(Named(:W), StartingAt(1), EndingAt(10), NStepsATime(2)) -- AddWalker(:W, 6, 10, [:NStepsATime, 3]) -- AddWalker(Named(:W), StartingAt(1), EndingAt(10), TakingNEqualMoves(3)) -- The walker is stored on THIS list (@aWalkers) and queried later with -- WalkedItems/WalkedPositions/... ( :By = <name> ).no extension
Walkers
The named walkers attached to this list.no extension
WalkedPositions
The positions visited by the given walker.no extension
WalkedItems
The items visited by the given walker.no extension
NumberOfWalkedItems
How many items the given walker visited.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfWalkedItems(TRUE)
#--> 0
composed from the signature, run for this page no extensionWalkedLastPosition
The last position the given walker reached.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.WalkedLastPosition(TRUE)
#--> 0
composed from the signature, run for this page no extensionWalkedLastItem
The item at the walker's last position.no extension
YieldWhileWalking
YieldWhileWalking: project each item the named walker visits through an -- engine W-DSL yielder (e.g. '@item * 2', 'Q(@item).Upper()'). Eval-free -- and engine-backed (stz_list_map_expr). For arbitrary Haro logic -- (ring_type, upper, StringContains, ...) use YieldWhileWalkingWF.QCSXTZZZIBWUWF
WalkNForward
walking the list n items forward
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNForward(2) )
#--> [ 1, 3, 5 ]
composed from the signature, run for this page QCSXTZZZIBWUWalkNBackward
walking the list n items backward
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNBackward(2) )
#--> [ 5, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWalkBetween
Same as WalkBetweenIB: Walk the inclusive range n1..n2 (descending if n1 > n2). The IB form takes a return type (:WalkedPositions default / :WalkedItems).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkBetween(2, 5) )
#--> [ 2, 3, 4, 5 ]
composed from the signature, run for this page QCSXTZZZIBWUWalkForthAndBack
Same as WalkForthAndBackXT: Walk forward 1..n then back n-1..1.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkForthAndBack() )
#--> [ 1, 2, 3, 4, 5, 4, 3, 2, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWalk forward up to and including the first occurrence of pItem.
1 examples runo1 = new stzList([ "A", "B", "C", "D", "E", "F" ])
? @@( o1.WalkUntilItem("D") )
#--> [ 1, 2, 3, 4 ]library testno extensionWalkW
Walk the list collecting where the W condition holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkW("@item > 3") )
#--> [ 1, 3 ]composed from the signature, run for this page no extensionWalkUntil
Walk the items UNTIL the given condition holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkUntil("@item > 3") )
#--> [ 1 ]composed from the signature, run for this page QCSXTZZZIBWUWalkWhile
Walk the items WHILE the given condition holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkWhile("@item > 3") )
#--> [ 1 ]composed from the signature, run for this page QCSXTZZZIBWUWalkZigZag
walking in zigzag pattern
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkZigZag(2) )
#--> [ 1, 3, 5, 5, 3, 1 ]
composed from the signature, run for this page no extensionWalkEveryNth
walking every nth position
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkEveryNth(2) )
#--> [ 2, 4 ]
composed from the signature, run for this page no extensionWalkFromTo
PositionsWhere already defined above as alias of FindAllItemsW
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkFromTo(2, 5) )
#--> [ 2, 3, 4, 5 ]
composed from the signature, run for this page no extensionWalkSkipping
walk skipping n items
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkSkipping(2) )
#--> [ 1, 4 ]
composed from the signature, run for this page no extensionWalkAccumulating
walk with custom accumulator
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkAccumulating("@item > 3") )
#--> [ 1, 0, 1, 0, 0 ]composed from the signature, run for this page no extensionWalkWhere
Walk the list collecting where the condition holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkWhere("@item > 3") )
#--> [ 1, 3 ]composed from the signature, run for this page no extensionWalkWhen
The When-walk over the items (see stzListWalker), driven by the given condition.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkWhen("@item > 3") )
#--> [ 1, 2, 3, 4, 5 ]composed from the signature, run for this page QCSXTZZZIBWUMove / Swap accept the named-param spellings Move(:ItemFromPosition = a, :To = b), Swap(:Positions = a, :And = b), and the value form Swap(item1, :And = item2).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Move(2, 5)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUManyExchange the items at the two given positions (mutating).
2 examples runalso named: exchange swap positions interchange two itemscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.Swap(2, 5)
? @@( o1.Content() )
#--> [ 5, 1, 8, 3, 3 ]
composed from the signature, run for this page no extensionMoveToStart
Move the item at position n to the START of the list (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.MoveToStart(2)
? @@( o1.Content() )
#--> [ 3, 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionMoveToEnd
Move the item at position n to the END of the list (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.MoveToEnd(2)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1, 3 ]
composed from the signature, run for this page no extensionSwapFirstAndLast
swap first and last
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SwapFirstAndLast()
? @@( o1.Content() )
#--> [ 1, 3, 8, 3, 5 ]
composed from the signature, run for this page no extensionRotateLeft
rotate -- circular shift
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RotateLeft(2)
? @@( o1.Content() )
#--> [ 8, 3, 1, 5, 3 ]
composed from the signature, run for this page no extensionRotatedLeft
rotate -- circular shift
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.RotatedLeft(2) )
#--> [ 8, 3, 1, 5, 3 ]
composed from the signature, run for this page no extensionRotateRight
rotate -- circular shift
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RotateRight(2)
? @@( o1.Content() )
#--> [ 3, 1, 5, 3, 8 ]
composed from the signature, run for this page no extensionRotatedRight
rotate -- circular shift
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.RotatedRight(2) )
#--> [ 3, 1, 5, 3, 8 ]
composed from the signature, run for this page no extensionShuffle
shuffle -- random reorderno extension
Shuffled
shuffle -- random reorderalso named: randomize mix scramble random order jumbleno extension
MoveItemToStart
move item by value
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.MoveItemToStart(3)
? @@( o1.Content() )
#--> [ 3, 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionMoveItemToEnd
move item by value
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.MoveItemToEnd(3)
? @@( o1.Content() )
#--> [ 5, 8, 3, 1, 3 ]
composed from the signature, run for this page no extensionSections
getting many sections (slices)no extension
FindAntiSection
finding the anti-section(s) of given section(s)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindAntiSection(2, 5) )
#--> [ [ 1, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUAntiSection
finding the anti-section(s) of given section(s)QCSXTZZZIBWU
The [start, end] sections OUTSIDE the given sections.
2 examples runo1 = new stzList("A":"J")
? @@( o1.FindAntiSections( :Of = [ [3, 5], [7, 8] ] ) )
? @@( o1.AntiSections(:Of = [ [3, 5], [7, 8] ] ) )
#--> [ [ 1, 2 ], [ 6, 6 ], [ 9, 10 ] ]
#--> [ [ "A", "B" ], [ "F" ], [ "I", "J" ] ]library testQCSXTZZZIBWUThe items lying outside the given sections.
1 examples runo1 = new stzList("A":"J")
? @@( o1.FindAntiSections( :Of = [ [3, 5], [7, 8] ] ) )
? @@( o1.AntiSections(:Of = [ [3, 5], [7, 8] ] ) )
#--> [ [ 1, 2 ], [ 6, 6 ], [ 9, 10 ] ]
#--> [ [ "A", "B" ], [ "F" ], [ "I", "J" ] ]library testQCSXTZZZIBWURanges
getting many ranges of the listno extension
AntiRanges
getting the anti-ranges of a given set of sectionsQCSXTZZZIBWU
RangesAndAntiRanges
getting the anti-ranges of a given set of sectionsQCSXTZZZIBWU
Classify
Group the items into classes of equal values.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Classify() )
#--> [ [ "tea", [ 1, 3 ] ], [ "rice", [ 2 ] ], [ "fish", [ 4 ] ] ]
composed from the signature, run for this page no extensionClassified
The items grouped into classes of equal values, as data.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Classified() )
#--> [ [ "tea", [ 1, 3 ] ], [ "rice", [ 2 ] ], [ "fish", [ 4 ] ] ]
composed from the signature, run for this page no extensionClasses
The distinct classes (values) of the list.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Classes() )
#--> [ "tea", "rice", "fish" ]
composed from the signature, run for this page no extensionClassesSF
Short-form classification for lists of (contiguous) number-lists: each list-class key is rendered as "min:max" (e.g. "1:5").no extension
ClassifySF
The classification of the items, in short form.also written: ClassifiedSFno extension
KlassSF
The members of the given class, short-form access.no extension
ClassifyBy
Group the items into classes by the given expression.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ClassifyBy("@item > 3") )
#--> [ [ "true", [ 1, 3 ] ], [ "false", [ 2, 4, 5 ] ] ]composed from the signature, run for this page no extensionNumberOfClasses
How many distinct classes the items form.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfClasses()
#--> 0
composed from the signature, run for this page no extensionFrequencies
frequency of each item
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Frequencies() )
#--> [ [ "5", 1 ], [ "3", 2 ], [ "8", 1 ], [ "1", 1 ] ]
composed from the signature, run for this page no extensionMostFrequent
most / least frequent
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.MostFrequent()
#--> 3
composed from the signature, run for this page no extensionLeastFrequent
most / least frequent
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.LeastFrequent()
#--> 5
composed from the signature, run for this page no extensionGroupBy
Group the items by the given expression.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.GroupBy("@item > 3") )
#--> [ [ "true", [ 1, 3 ] ], [ "false", [ 2, 4, 5 ] ] ]composed from the signature, run for this page no extensionHistogram
histogram -- frequency as pairs [value, count]
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Histogram() )
#--> [ [ "5", 1 ], [ "3", 2 ], [ "8", 1 ], [ "1", 1 ] ]
composed from the signature, run for this page no extensionItemsAppearingNTimes
items appearing exactly n times
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsAppearingNTimes(2) )
#--> [ "3" ]
composed from the signature, run for this page no extensionItemsAppearingMoreThanNTimes
items appearing more/less than n timesno extension
ItemsAppearingLessThanNTimes
items appearing more/less than n times
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsAppearingLessThanNTimes(2) )
#--> [ "5", "8", "1" ]
composed from the signature, run for this page no extensionFrequencyOf
frequency of a specific item
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FrequencyOf(3)
#--> 2
composed from the signature, run for this page no extensionMode
mode -- most common items (all ties)
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Mode() )
#--> [ "3" ]
composed from the signature, run for this page no extensionBisect
bisection -- split into halves
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Bisect() )
#--> [ [ 5, 3, 8 ], [ 3, 1 ] ]
composed from the signature, run for this page no extensionFirstHalf
The first floor(n/2) items of the list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FirstHalf() )
#--> [ 5, 3 ]
composed from the signature, run for this page QCSXTZZZIBWUSecondHalf
The items from floor(n/2)+1 on (the longer half when odd).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SecondHalf() )
#--> [ 8, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUPartitionW
Partition the items into [satisfying, not-satisfying] by the W condition.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.PartitionW("@item > 3") )
#--> [ [ 5, 8 ], [ 3, 3, 1 ] ]composed from the signature, run for this page no extensionChunks
chunk -- split into groups of size n
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Chunks(2) )
#--> [ [ 5, 3 ], [ 8, 3 ], [ 1 ] ]
composed from the signature, run for this page no extensionRandomPosition
getting a random position in the list
also written: APosition · AnyPosition · ARandomPositioncomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AnyPosition()
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUExceptRandomSection
A random [start, end] pair within the list's positions.
also written: ASection · AnySection · ARandomSectioncomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ASection() )
#--> [ 4, 4 ]
composed from the signature, run for this page no extensionRandomPositionGreaterThan
getting a random position greater than / less than the one providedno extension
RandomPositionLessThan
getting a random position greater than / less than the one providedno extension
RandomPositionExceptPositions
getting a random position except one / manyno extension
NRandomPositions
getting n random positions in the listno extension
RandomItemExceptPosition
getting a random item except at the given positionno extension
Randomize
randomizing the items positions in the listno extension
Randomized
randomizing the items positions in the listno extension
randomizing the numbers existing in the list
1 examples runno extensionRandomiseNumbers
Same as RandomizeNumbers: randomizing the numbers existing in the listno extension
ShuffleNumbers
Same as RandomizeNumbers: randomizing the numbers existing in the listno extension
randomizing the strings existing in the list
1 examples runno extensionRandomiseStrings
Same as RandomizeStrings: randomizing the strings existing in the listno extension
ShuffleStrings
Same as RandomizeStrings: randomizing the strings existing in the listno extension
randomizing the items positions in the given section of the list
1 examples runno extensionSectionRandomized
randomizing the items positions in the given section of the listno extension
YieldOn
Evaluate the yielder expression over the items and return the results AT the given positions.no extension
YieldAtW
YieldW(pcCondition, pcYielder): the @item-syntax form of YieldW -- for items matching pcCondition, yield the value of pcYielder. Engine-backed via YieldW (no eval). YieldAtW / YieldAtW: restrict to the given positions first, then yield over those.no extension
Where
Same as ItemsW: ItemsW / ItemsW / ItemsWXTQ: filter the list by an evaluated Haro expression where @item is the loop variable. Returns the items for which the expression is truthy. ItemsWXTQ wraps the result in stzList for fluent chains.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Where("@item > 3") )
#--> [ 5, 8 ]composed from the signature, run for this page no extensionYieldPairs
yield pairs [position, item]no extension
AssociateWith
Pair each item with its counterpart in the given list: [ [item, other], ... ].
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.AssociateWith([ 2, 3 ]) )
#--> [ [ 5, 2 ], [ 3, 3 ], [ 8, "" ], [ 3, "" ], [ 1, "" ] ]
composed from the signature, run for this page no extensionAssociatedWith
The item/counterpart pairs, as data (the passive twin of AssociateWith).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.AssociatedWith([ 2, 3 ]) )
#--> [ [ 5, 2 ], [ 3, 3 ], [ 8, "" ], [ 3, "" ], [ 1, "" ] ]
composed from the signature, run for this page no extensionInterleaveWith
Interleave the given list's items with this one's (mutating).no extension
InterleavedWith
The items interleaved with the given list's items, alternating.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.InterleavedWith([ 2, 3 ]) )
#--> [ 5, 2, 3, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionZipWith
zip -- pair items from two lists
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ZipWith([ 2, 3 ]) )
#--> [ [ 5, 2 ], [ 3, 3 ] ]
composed from the signature, run for this page no extensionZippedWith
zip -- pair items from two lists
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ZippedWith([ 2, 3 ]) )
#--> [ [ 5, 2 ], [ 3, 3 ] ]
composed from the signature, run for this page no extensionUnzip
unzip -- split pairs into two listsno extension
Unzipped
unzip -- split pairs into two listsno extension
PrependWith
Put the given list's items in front (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.PrependWith([ 2, 3 ])
? @@( o1.Content() )
#--> [ 2, 3, 5, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionPrependedWith
A copy with the given list's items put in front.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.PrependedWith([ 2, 3 ]) )
#--> [ 2, 3, 5, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionDiffWith
diff -- items in this but not in other
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DiffWith([ 2, 3 ]) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extensionIntersectWith
Set-ops fetch the engine RESULT HANDLE from the merger (a number, no list copy) and unmarshal ONCE here -- one Haro method-return copy instead of two (merger return + this return).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.IntersectWith([ 2, 3 ]) )
#--> [ 3 ]
composed from the signature, run for this page no extensionUnionWith
Keep the UNION with the given list -- set semantics (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.UnionWith([ 2, 3 ]) )
#--> [ 5, 3, 8, 1, 2 ]
composed from the signature, run for this page no extensionInsert
inserting an item before a given positionalso named: put at position add at place into inject at indexno extension
InsertBeforePosition
inserting an item before a given position
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.InsertBeforePosition(2, 3)
? @@( o1.Content() )
#--> [ 3, 5, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionInsertAfterPosition
inserting an item after a given position
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.InsertAfterPosition(2, 3)
? @@( o1.Content() )
#--> [ 5, 3, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionInsertBeforePositions
Insert the item before EACH of the given positions (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.InsertBeforePositions([ 2, 3 ], 3)
? @@( o1.Content() )
#--> [ 5, 3, 3, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionAreBoundsOf
Same as AreBoundsOfCS: checking if the 2 items are bounds of a substringQCSXTZZZIBWU
Same as IsBoundedByCS: checking if the list is bounded by the given two items
2 examples runo1 = new stzList([ "{", "A", "B", "C", "}" ])
? o1.IsBoundedBy([ "{", "}" ]) + NL
o1.RemoveTheseBounds("{", "}")
? o1.Content()
#--> 1
#--> A
#--> B
#--> Clibrary testQCSXTZZZIBWUgetting bounds of the list up to n items
1 examples runo1 = new stzList([ "{", "<", "A", "B", "C", ">", "}" ])
? @@( o1.BoundsUpToNItems(1) ) + NL
? @@( o1.BoundsUpToNItems(2) )
#--> [ "{", "}" ]
#--> [ [ "{", "<" ], [ ">", "}" ] ]library testno extensionBounds
getting bounds of the list up to n items
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Bounds() )
#--> [ 5, 1 ]
composed from the signature, run for this page QCSXTZZZIBWURemoveBounds
Same as RemoveBoundsCS: Remove the given bounds from the ends of the list (mutating).QCSXTZZZIBWU
BoundsRemoved
A copy of the list with the given bounds removed; the original is unchanged.no extension
Middle
getting the middle of the list
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Middle() )
#--> [ 3, 8, 3 ]
composed from the signature, run for this page no extensionClampedTo
clamped to min/max values
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ClampedTo(2, 5) )
#--> [ 5, 3, 5, 3, 2 ]
composed from the signature, run for this page no extensionClampTo
clamped to min/max valuesno extension
IsWithinBounds
check if position is within bounds
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsWithinBounds(2)
#--> 1
composed from the signature, run for this page no extensionItemsBetweenPositions
items between two positions
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsBetweenPositions(2, 5) )
#--> [ 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionOn any unknown predicate / type, the side fails silently and returns FALSE rather than crashing -- callers can rely on the method always returning a boolean.
2 examples runalso written: ItemsAreEither · ItemsHaveEither · EachItemIsEither · EachItemIsEitherA · AllItemsHaveEither · EachItemIsEitherAno1 = new stzList([ 6, -2, 9, 5, -10 ])
? o1.EachItemIsEitherA(:Positive, :Or = :Negative, :Number)
#--> 1
library testno extensionSame as DeepContainsCS: stzListPaths has only 3 methods - minimal, skip for now -- DeepRemove / DeepRemoveMany: walk the nested list structure and drop any item that matches pItem / any item in paItems. Recurses into nested lists. Ported from archive line 16144; simpler implementation here -- pure structural walk, no @@()-stringification round-trip. DeepContains / DeepContainsCS: does the (nested) list contain pItem at any depth? Recursive walk. Complements DeepRemove.
2 examples runalso written: DeeplyContainscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.DeepContains(3)
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUManyDeep find: the index-path to every (nested) occurrence of pItem. Engine-backed via the stzDeepList wrapper (stz_list_deep_find).
2 examples runalso written: DeepFindAllcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DeepFind(3) )
#--> [ [ 2 ], [ 4 ] ]
composed from the signature, run for this page QCSXTZZZIBWUPaths
Paths(): the index-path to every node (containers AND leaves) of the nested list, in depth-first order. Documented Softanza feature whose wiring was dropped in the split; engine-backed (stz_list_deep_paths) -- same all-node format as the reference GeneratePaths() in stzListPaths.also written: AllPathsno extension
Every list-valued item at any depth (depth-first pre-order). Objects are excluded (isList is false for them). E.g. ListsAtAnyLevel.
1 examples runo1 = new stzList([ "A", 1:3, NullObject(), "B", [ "C", 4:5, [ "V", 6:8, ["T", 9:12 ,"K"] ] ], "D" ])
? @@( o1.DeepLists() ) # Or ListsAtAnyLevel()
#--> [ [ 1, 2, 3 ], [ "C", [ 4, 5 ], [ "V", [ 6, 7, 8 ], [ "T", [ 9, 10, 11, 12 ], "K" ] ] ], [ 4, 5 ], [ "V", [ 6, 7, 8 ], [ "T", [ 9, 10, 11, 12 ], "K" ] ], [ 6, 7, 8 ], [ "T", [ 9, 10, 11, 12 ], "K" ], [ 9, 10, 11, 12 ] ]
library testno extensionListsAtAnyLevel
Every sublist at ANY nesting depth.no extension
FilledWith
FilledWith(pItems): replace the wrapped list with pItems, then return its content. Used for the 'start from an empty list and fill it with these items' fluent shape.QCSXTZZZIBWU
Same as DeepReplaceCS: DeepReplace: recursive replace -- walk nested lists and substitute every occurrence of pOld with pNew. The recursion enters every list sublist; non-list items are compared with Haro's = (deep-equal for lists, value-equal for scalars).
2 examples runQCSXTZZZIBWUDeeplyReplace
Same as DeepReplace: Same as DeepReplaceCS: DeepReplace: recursive replace -- walk nested lists and substitute every occurrence of pOld with pNew. The recursion enters every list sublist; non-list items are compared with Haro's = (deep-equal for lists, value-equal for scalars).no extension
Remove every occurrence of the item at ANY depth of the nested list (mutating).
1 examples runQCSXTZZZIBWUManyDeepRemoved
A copy with the item removed at ANY depth; the original is unchanged.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DeepRemoved(3) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extensionManyDeepRemoved
A copy with each given item removed at any depth.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ManyDeepRemoved([ 2, 3 ]) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extensionUnicodes
The Unicode codepoint of each character-string item in the list.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Unicodes() )
#--> [ [ 116, 101, 97 ], [ 114, 105, 99, 101 ], [ 116, 101, 97 ], [ 102, 105, 115, 104 ] ]
composed from the signature, run for this page no extensionNames
The names of the items (char names for chars, object names for objects).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Names() )
#--> [ "<control>", "<control>", "<control>", "<control>", "<control>" ]
composed from the signature, run for this page no extensionSortOnDown
SortOnDown / SortedOnDown for stzList: when the list is flat (numbers / strings), forwards to descending sort on the whole list. When the list is a list-of-lists, forwards to the stzListOfLists.SortOnDown(n) which sorts on column n.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SortOnDown(2)
? @@( o1.Content() )
#--> [ 8, 5, 3, 3, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUSortedOnDown
A descending-sorted copy; the original is unchanged.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SortedOnDown(2) )
#--> [ 8, 5, 3, 3, 1 ]
composed from the signature, run for this page no extensionIsMadeOfNumbersOrStrings
IsMadeOf*: predicates that answer "is every item one of the listed types?". Used by the narrative tests for mixed-content guards. The Or/And variants are synonyms -- both mean 'every item is in {numbers, strings}'.
also written: IsMadeOfNumbersAndStringscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfNumbersOrStrings()
#--> 1
composed from the signature, run for this page no extensionIsMadeOfNumbers
Same as IsListOfNumbers: TRUE if the list is non-empty and every item is a number.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfNumbers()
#--> 1
composed from the signature, run for this page no extensionIsMadeOfStrings
Same as IsListOfStrings: TRUE if the list is non-empty and every item is a string.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfStrings()
#--> 0
composed from the signature, run for this page no extensionTypes(): map ring_type over the items, return the list of type tags. "STRING", "NUMBER", "LIST", "OBJECT". Used by the RepeatedInAPair narrative tests on stzObject.
3 examples run? @@( StzListQ([ "a", 1, "b", 2, "c", 3 ]).Types() ) + NL
? StzListQ([ "a", 1, "b", 2, "c", 3 ]).UniqueTypes()
#--> [ "STRING", "NUMBER", "STRING", "NUMBER", "STRING", "NUMBER" ]
#--> STRING
#--> NUMBER
library testQCSXTZZZIBWUUnique list of the item types (Types() with duplicates removed)
1 examples run? @@( StzListQ([ "a", 1, "b", 2, "c", 3 ]).Types() ) + NL
? StzListQ([ "a", 1, "b", 2, "c", 3 ]).UniqueTypes()
#--> [ "STRING", "NUMBER", "STRING", "NUMBER", "STRING", "NUMBER" ]
#--> STRING
#--> NUMBER
library testQCSXTZZZIBWUItemsAndTheirTypes: each item paired with its type name, in order. -- e.g. [ 1, "A", [2] ] -> [ [1,"NUMBER"], ["A","STRING"], [[2],"LIST"] ].
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemsAndTheirTypes() )
#--> [ [ 5, "NUMBER" ], [ 3, "NUMBER" ], [ 8, "NUMBER" ], [ 3, "NUMBER" ], [ 1, "NUMBER" ] ]
composed from the signature, run for this page QCSXTZZZIBWUTypesAndTheirSections (alias TypesZZ): group the list into maximal -- runs of one type, then collect, per distinct type, the [start,end] -- position ranges of its runs. e.g. [1,2,"A",3] -> -- [ ["NUMBER",[[1,2],[4,4]]], ["STRING",[[3,3]]] ].
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.TypesAndTheirSections() )
#--> [ [ "NUMBER", [ [ 1, 5 ] ] ] ]
composed from the signature, run for this page QCSXTZZZIBWUThe items that are NOT numbers (engine DSL)
1 examples runalso written: OnlyNonNumberso1 = new stzList([ "A", "B", 1, "C", 2, 3, "D", 4, 5 ])
? o1 - These( o1.NonNumbers() )
#--> 1
#--> 2
#--> 3
#--> 4
#--> ...
library testQCSXTZZZIBWUA copy of the list with every numeric 0 removed (non-mutating)
1 examples runo1 = new stzList([ "A", 0, 0, "B", "C", 0, "D", 0, 0 ])
? o1.ZerosRemoved()
#--> A
#--> B
#--> C
#--> D
library testQCSXTZZZIBWUThe nth item counted from the end: NthToLast(1) is the item -- before the last, NthToLast(2) the one before it, and so on.
1 examples runo1 = new stzList([ "S", "O", "F", "T", "A", "N", "Z", "A" ])
? o1.NthToLast(2)
#--> N
library testno extensionShrink the list down to its first n items (mutating). -- Accepts Shrink(n) or the named form Shrink(:ToPosition = n).
1 examples runo1 = new stzList([ "A", "B", "C", "D", "E" ])
o1.Shrink( :ToPosition = 3 )
# Shrink(:ToPosition = 3) keeps only the first three items
? @@( o1.Content() )
#--> [ "A", "B", "C" ]
library testQCSXTZZZIBWUSwap two items by position (mutating). Accepts SwapItems(n1, n2) -- or the named form SwapItems(:AtPositions = n1, :And = n2).
1 examples runQCSXTZZZIBWUA two-item list whose both items share a given type.
1 examples runalso written: Contains2Numbers · ContainsTwoNumberscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreNumbers()
#--> 0
composed from the signature, run for this page no extensionBothAreStrings
For a PAIR: TRUE if both items are strings.
also written: Contains2Strings · ContainsTwoStringscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreStrings()
#--> 0
composed from the signature, run for this page no extensionBothAreLists
For a PAIR: TRUE if both items are lists.
also written: Contains2Lists · ContainsTwoListscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreLists()
#--> 0
composed from the signature, run for this page no extensionBothAreObjects
For a PAIR: TRUE if both items are objects.
also written: Contains2Objects · ContainsTwoObjectscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreObjects()
#--> 0
composed from the signature, run for this page no extensionIsMadeOf family: "the list consists of these items". -- IsMadeOf / IsMadeOfThese -> contains ALL the given items.
1 examples runo1 = new stzList([ "a", "b", "c", "a", "a", "b", "c" ])
? o1.IsMadeOf([ "a", "b", "c" ])
? o1.IsMadeOfSome([ "a", "b", "c", "x", "z" ])
#--> 1
#--> 1
library testno extensionSame as ContainsMany: Same as ContainsManyCS: ContainsManyCS: check if list contains multiple items
1 examples runo1 = new stzList([ "by", "except", "stopwords" ])
? o1.IsMadeOfThese([ :by, :except, :stopwords ])
#--> 1
library testno extensionTRUE if every item is of the given type.
2 examples runalso written: ContainsOnlyo1 = new stzList([ "a", "a", "A", "A", "a", "A" ])
? o1.ItemsAreEqualTo("a")
? o1.ItemsAreEqualToCS("a", FALSE)
? o1.ContainsOnly("a")
? o1.ContainsOnlyCS("A", FALSE)
#--> 0
#--> 1
#--> 0
#--> 1library testQCSXTZZZIBWUContainsSome
Same as ContainsSomeCS: ContainsSome / IsMadeOfSome -> contains some (one or more) of them.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsSome([ 2, 3 ])
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUIsMadeOfSomeOfThese
Same as ContainsSomeCS: ContainsSome / IsMadeOfSome -> contains some (one or more) of them.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfSomeOfThese([ 2, 3 ])
#--> 1
composed from the signature, run for this page no extensionIsMadeOfOneOrMoreOfThese
Same as ContainsSomeCS: ContainsSome / IsMadeOfSome -> contains some (one or more) of them.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfOneOrMoreOfThese([ 2, 3 ])
#--> 1
composed from the signature, run for this page no extensionIsMadeOfOneOrMoreOf
Same as ContainsSomeCS: ContainsSome / IsMadeOfSome -> contains some (one or more) of them.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfOneOrMoreOf([ 2, 3 ])
#--> 1
composed from the signature, run for this page no extensionSame as BoundsCS: Thin aliases over existing methods (restored from the monolith). Bounds of an item: for each occurrence of pItem, the up-to-N items immediately before and after it. pUpTo is a number (same count both sides) or a [before, after] pair. Accepts the named form BoundsOf(item, :UpToNItems = n). (Bounds() no-arg already exists, so the parametered form lives under BoundsCS/BoundsOf.)
1 examples runno extensionNBoundsOf
Same as BoundsCS: Thin aliases over existing methods (restored from the monolith). Bounds of an item: for each occurrence of pItem, the up-to-N items immediately before and after it. pUpTo is a number (same count both sides) or a [before, after] pair. Accepts the named form BoundsOf(item, :UpToNItems = n). (Bounds() no-arg already exists, so the parametered form lives under BoundsCS/BoundsOf.)no extension
Klass
The members of the given class (from Classify).no extension
OnlyWhere
Same as ItemsW: ItemsW / ItemsW / ItemsWXTQ: filter the list by an evaluated Haro expression where @item is the loop variable. Returns the items for which the expression is truthy. ItemsWXTQ wraps the result in stzList for fluent chains.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.OnlyWhere("@item > 3") )
#--> [ 5, 8 ]composed from the signature, run for this page QCSXTZZZIBWURemoveItemCS
Same as RemoveAllCS: RemoveAllCS: remove all occurrences of an item
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveItemCS(3, TRUE)
? @@( o1.Content() )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extensionContainsAtLeastOneW
Same as ContainsW: True if at least one item satisfies the W condition.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsAtLeastOneW("@item > 3")
#--> 1composed from the signature, run for this page no extensionSame as SectionsBetweenCS: Every section that starts at an occurrence of pItem1 and ends at -- a later occurrence of pItem2. Accepts SectionsBetween(a, :And = b).
1 examples runalso written: SectionsBetweenItemsQCSXTZZZIBWUDistribute the items over the given beneficiaries, round-robin.
1 examples runQCSXTZZZIBWUA copy with all occurrences of an item removed (non-mutating).
1 examples runalso written: AllOccurrencesOfThisItemRemovedcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemRemoved(3) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page QCSXTZZZIBWUTrue if EVERY given position holds an item matching a W condition.
1 examples runalso written: ContainsAtWcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsItemsAtW([ 2, 3 ], "@item > 3")
#--> 0
composed from the signature, run for this page no extensionSame as EachContainsCS: EachContains: every item (string or sub-list) contains pItem.
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.EachContains(3)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUEachItemContains
Same as EachContainsCS: EachContains: every item (string or sub-list) contains pItem.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.EachItemContains(3)
#--> 0
composed from the signature, run for this page QCSXTZZZIBWUSame as EachContainsTheseCS: EachContainsThese: every item contains all the given items.
1 examples run# containsthese example 1
? @@( Q([ "a", "♥", "*" ]).ContainsThese([ "♥", "*"]) )
o1 = new stzList([ [ "a", "♥", "*" ], [ "♥", "*"], [ "a", "b", "♥", "*" ] ])
# containsthese example 2
? @@( o1.EachContainsThese([ "♥", "*" ]) )
#--> 1
#--> 1
library testQCSXTZZZIBWUThe items shared with the given list.
1 examples runalso written: Commono1 = new stzList([ "green", "red" ])
? @@( o1.DifferenceWith([ "b","x", "a", "f"]) ) # Or DifferentItemsWith()
? @@( o1.CommonItemsWith([ "b","x", "a", "f"]) ) # or Intersection()
? o1.ContainsSameItemsAs([ "red", "green" ])
? o1.ContainsSameItemsAs([ "a", "b", "c", "f" ])
#--> [ "green", "red", "b", "x", "a", "f" ]
#--> [ ]
#--> 1
#--> 0
library testno extensionIntersectionWith
The items shared with the given list (pairwise intersection).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.IntersectionWith([ 2, 3 ]) )
#--> [ 3 ]
composed from the signature, run for this page no extensionDifferentItemsWith
Same as DifferentItemsWithCS: Symmetric difference: (this items not in other) ++ (other items not -- in this). Engine-faithful element compare via BothAreEqualCS.
also written: Diffcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DifferentItemsWith([ 2, 3 ]) )
#--> [ 5, 8, 1, 2 ]
composed from the signature, run for this page QCSXTZZZIBWUXTTSame as ContainsSameItemsAsCS: Same items as another list, regardless of order/count (set equality).
1 examples runo1 = new stzList([ "green", "red" ])
? @@( o1.DifferenceWith([ "b","x", "a", "f"]) ) # Or DifferentItemsWith()
? @@( o1.CommonItemsWith([ "b","x", "a", "f"]) ) # or Intersection()
? o1.ContainsSameItemsAs([ "red", "green" ])
? o1.ContainsSameItemsAs([ "a", "b", "c", "f" ])
#--> [ "green", "red", "b", "x", "a", "f" ]
#--> [ ]
#--> 1
#--> 0
library testQCSXTZZZIBWUIsContainedIn
Same as IsContainedInCS: IsContainedIn(p): this list, taken as a single value, is an -- element of p (NOT element-wise -- that is AreContainedIn).QCSXTZZZIBWU
Same as IsContainedInCS: IsContainedIn(p): this list, taken as a single value, is an -- element of p (NOT element-wise -- that is AreContainedIn).
1 examples run? Q(["a", "b", "c"]).ExistsIn(["a", "b", "c", "x", "z"])
? @@(Q(["a", "b", "c", "x", "z"]).FindAll(["a", "b", "c"]))
? Q(["a", "b", "c"]).ExistsIn(["a", "b", "c", "x", "z", ["a", "b", "c"]])
? Q(["a", "b", "c"]).ExistIn(["a", "b", "c", "x", "z"])
#--> 0
#--> [ ]
#--> 1
#--> 1
library testQCSXTZZZIBWUSame as EachItemExistsInCS: AreContainedIn / ExistIn: every item of this list also exists -- somewhere in the other list (element-wise membership).
1 examples runo1 = new stzList([ "A", "B", "C" ])
? o1.EachItemExistsIn([ "1", "2", "A", "B", "C", "3", "4" ])
#--> 1
library testQCSXTZZZIBWUSame as EachItemExistsInCS: AreContainedIn / ExistIn: every item of this list also exists -- somewhere in the other list (element-wise membership).
1 examples run? Q(["a", "b", "c"]).ExistsIn(["a", "b", "c", "x", "z"])
? @@(Q(["a", "b", "c", "x", "z"]).FindAll(["a", "b", "c"]))
? Q(["a", "b", "c"]).ExistsIn(["a", "b", "c", "x", "z", ["a", "b", "c"]])
? Q(["a", "b", "c"]).ExistIn(["a", "b", "c", "x", "z"])
#--> 0
#--> [ ]
#--> 1
#--> 1
library testno extensionAreContainedIn
Same as EachItemExistsInCS: AreContainedIn / ExistIn: every item of this list also exists -- somewhere in the other list (element-wise membership).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AreContainedIn([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extensionHasSameSizeAs
Same as HasSameNumberOfItemsAsCS: HasSameNumberOfItemsAs: same length as another list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasSameSizeAs([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extensionHasSameWidthAs
Same as HasSameNumberOfItemsAsCS: HasSameNumberOfItemsAs: same length as another list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasSameWidthAs([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extensionContainsNoOneOfThese
Negative form of ContainsOneOfThese.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNoOneOfThese([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extensionContainsNoneOfThese
TRUE if NONE of the given items occurs in the list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNoneOfThese([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extensionContainsNoItemOfThese
TRUE if NONE of the given items occurs in the list.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNoItemOfThese([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extensionObjects
Objects: the items that are objects.also written: OnlyObjectsQCSXTZZZIBWU
NumbersAndStrings: the scalar items (numbers or strings). -- The Z form pairs each with its 1-based position.
1 examples runalso written: StringsAndNumberso1 = new stzList( 10:12 + "str1" + "str2" + [ "+", "-" ] + o1 )
# numbersandstrings example 1
? @@( o1.NumbersAndStrings() )
# numbersandstrings example 2
? @@( o1.NumbersAndStringsZ() )
#--> [ 10, 11, 12, "str1", "str2" ]
#--> [ [ 10, 1 ], [ 11, 2 ], [ 12, 3 ], [ "str1", 4 ], [ "str2", 5 ] ]
library testQCSXTZZZIBWULowercased
A copy with every string item lower/upper-cased (UTF-8 via the -- engine-backed StzLower/StzUpper); non-string items pass through.
also written: StringsLowercasedcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Lowercased() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionUppercased
A copy with every string item uppercased; the original is unchanged.
also written: StringsUppercasedcomposed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Uppercased() )
#--> [ "TEA", "RICE", "TEA", "FISH" ]
composed from the signature, run for this page no extensionVizFindAllOccurrences
Same as VizFindAllOccurrencesCS: VizFind: a visual map of where a char occurs -- the list rendered -- as code, with a "^"/"-" marker line underneath. (Chars only, as the -- markers align to single columns; generalising is a TODO.)QCSXTZZZIBWU
Same as VizFindCS: A visual map of where the item occurs: the list rendered as code with ^ marks.
2 examples runQCSXTZZZIBWUManyVizFindAll
Same as VizFindCS: A visual map of where the item occurs: the list rendered as code with ^ marks.no extension
Same as VizDeepFindCS: VizDeepFind* : like VizFind*, but the markers ALSO cover occurrences -- nested inside sub-lists (any bracket depth), not just top-level ones. -- The "(count)" is the total occurrences, same as the deep markers.
1 examples runQCSXTZZZIBWUVizDeepFindAll
Same as VizDeepFindCS: VizDeepFind* : like VizFind*, but the markers ALSO cover occurrences -- nested inside sub-lists (any bracket depth), not just top-level ones. -- The "(count)" is the total occurrences, same as the deep markers.no extension
Numbers
Type-filter family: Xs() = items of type X, XsZ() = [item,pos] -- pairs, NumberOfXs() = count. Char = single-codepoint string -- (StzLen=1); Letter = a single ASCII letter.QCSXTZZZIBWU
NumberOfNumbers
How many NUMBER items the list holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfNumbers()
#--> 5
composed from the signature, run for this page no extensionStrings
Only the STRING items of the list.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Strings() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page QCSXTZZZIBWUWFNumberOfStrings
How many STRING items the list holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfStrings()
#--> 0
composed from the signature, run for this page no extensionChars
Only the CHAR items of the list.QCSXTZZZIBWU
Letters
Only the LETTER items of the list.QCSXTZZZIBWU
NumberOfLetters
How many LETTER items the list holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfLetters()
#--> 0
composed from the signature, run for this page no extensionLists
Only the LIST items of the list.QCSXTZZZIBWU
NumberOfLists
How many LIST items the list holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfLists()
#--> 0
composed from the signature, run for this page no extensionNumberOfPairs
How many pairs the list holds.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfPairs()
#--> 0
composed from the signature, run for this page no extensionExtend the list up to position n. ExtendToPosition pads with 0 -- (number lists) or "" ; the WithItemsIn/Repeated forms pad by -- cycling through a given list (or the list's own items).
1 examples runo1 = new stzList([ 1, 2, 3])
o1.ExtendToPosition(5)
? @@( o1.Content() )
o1.ExtendToPositionXT( 8, :With = 5 )
? @@(o1.Content())
#--> [ 1, 2, 3, 0, 0 ]
#--> [ 1, 2, 3, 0, 0, 5, 5, 5 ]
library testQCSXTZZZIBWUExtendToPositionWithItemsIn
Extend the list to position n by cycling the given items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.ExtendToPositionWithItemsIn(2, [ 2, 3 ])
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSame as ExtendToPositionWithItemsIn: Extend the list to position n by cycling the given items (mutating).
1 examples runo1 = new stzList(1 : 3)
o1.ExtendToWithItemsIn( 8, "A":"C" )
# extendtowithitemsin example 1
? @@( o1.Content() )
#--> [ 1, 2, 3, "A", "B", "C", "A", "B" ]
library testno extensionExtendToPositionWithItemsRepeated
Extend to position n by cycling the list's own items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.ExtendToPositionWithItemsRepeated(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionExtendToWithItemsRepeated
Same as ExtendToPositionWithItemsRepeated: Extend to position n by cycling the list's own items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.ExtendToWithItemsRepeated(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionExtendToByRepeatingItems
Same as ExtendToPositionWithItemsRepeated: Extend to position n by cycling the list's own items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.ExtendToByRepeatingItems(2)
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionSize comparison with another list. Accept the named form -- IsLarger(:Than = otherList) or the raw list.
1 examples runalso written: IsLarger · HasMoreItems · IsLargerThan? Q([1, 2, 3, 4, 5]).IsLarger(:Than = [8, 9])
? Q([1, 2, 3, 4, 5]).HasMoreItems(:Than = [8, 9])
? Q([8, 9]).IsSmaller(:Than = [1, 2, 3, 4, 5])
? Q([8, 9]).HasLessItems(:Than = [1, 2, 3, 4, 5])
#--> 1
#--> 1
#--> 1
#--> 1
library testno extensionTRUE if this list has fewer items than the given one.
1 examples runalso written: IsSmaller · HasLessItems · HasFewerItems · IsSmallerThan? Q([1, 2, 3, 4, 5]).IsLarger(:Than = [8, 9])
? Q([1, 2, 3, 4, 5]).HasMoreItems(:Than = [8, 9])
? Q([8, 9]).IsSmaller(:Than = [1, 2, 3, 4, 5])
? Q([8, 9]).HasLessItems(:Than = [1, 2, 3, 4, 5])
#--> 1
#--> 1
#--> 1
#--> 1
library testno extensionIsListOfEmptyLists: every item is an empty list.
1 examples runalso written: AllItemsAreEmptyLists · ContainsOnlyEmptyLists? Q([ [], [] ]).AllItemsAreEmptyLists()
? @@( Association([ [], [] ]) )
#--> 1
#--> [ ]
library testno extensionFindFirstDuplicates
Same as FindFirstDuplicatesCS: First-occurrence positions of the items that are duplicated -- ("duplicate origins"). Built engine-first: the duplicated VALUES -- come from the engine-backed DuplicatedItemsCS, and each value's -- first position from the engine-backed FindFirstCS -- avoiding the -- monolith's O(n^2) StzFind loop (whose arg order is ambiguous now).
also written: FindDuplicatesOrigins · FindDuplicationsOriginscomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindFirstDuplicates() )
#--> [ 2 ]
composed from the signature, run for this page QCSXTZZZIBWUFindFirstDuplicatedItems
Same as FindFirstDuplicatesCS: First-occurrence positions of the items that are duplicated -- ("duplicate origins"). Built engine-first: the duplicated VALUES -- come from the engine-backed DuplicatedItemsCS, and each value's -- first position from the engine-backed FindFirstCS -- avoiding the -- monolith's O(n^2) StzFind loop (whose arg order is ambiguous now).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindFirstDuplicatedItems() )
#--> [ 2 ]
composed from the signature, run for this page no extensionFindFirstOccurrenceOfEachDuplicatedItem
Same as FindFirstDuplicatesCS: First-occurrence positions of the items that are duplicated -- ("duplicate origins"). Built engine-first: the duplicated VALUES -- come from the engine-backed DuplicatedItemsCS, and each value's -- first position from the engine-backed FindFirstCS -- avoiding the -- monolith's O(n^2) StzFind loop (whose arg order is ambiguous now).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindFirstOccurrenceOfEachDuplicatedItem() )
#--> [ 2 ]
composed from the signature, run for this page no extensionSame as FindFirstDuplicatesCS: First-occurrence positions of the items that are duplicated -- ("duplicate origins"). Built engine-first: the duplicated VALUES -- come from the engine-backed DuplicatedItemsCS, and each value's -- first position from the engine-backed FindFirstCS -- avoiding the -- monolith's O(n^2) StzFind loop (whose arg order is ambiguous now).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDupOrigins() )
#--> [ 2 ]
composed from the signature, run for this page no extensionRemove the first occurrence of each duplicated item (mutating).
1 examples runcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveDupOrigins()
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionRemoveDuplicatesOrigins
Same as RemoveDupOrigins: Remove the first occurrence of each duplicated item (mutating).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.RemoveDuplicatesOrigins()
? @@( o1.Content() )
#--> [ 5, 8, 3, 1 ]
composed from the signature, run for this page no extensionoperator
For element-wise operations, use the explicit method calls (AddMany / RemoveMany / etc.) -- the operator is reserved for the simple "single item" reading.no extension
(no comment in the source: the name reads as a sentence) contains no duplicates 1 examples runalso written: NoItemsAreDuplicated · ContainsNoDuplicationsin the section monolith -- split-dropped, authoritative semantics).o1 = new stzList([ "A", "B", "2", 1:3, "C", 2 ])
# noitemsareduplicated example 1
? @@( o1.NoItemsAreDuplicated() )
o1 = new stzList("A":"E")
# noitemsareduplicated example 2
? @@( o1.NoItemsAreDuplicated() )
#--> 1
#--> 1library testQCSXTZZZIBWU ContainsNonDuplicatedItems
Same as ContainsNonDuplicatedItemsCS: NON-DUPLICATED ITEMS TRUE if at least one item occurs exactly once.
also written: ContainsItemsNonDuplicated · ContainsAtLeastOneNonDuplicatedItemcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNonDuplicatedItems()
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUContainsItemsThatAreNotDuplicatedCS
Same as ContainsNonDuplicatedItemsCS: NON-DUPLICATED ITEMS TRUE if at least one item occurs exactly once.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsItemsThatAreNotDuplicatedCS(TRUE)
#--> 1
composed from the signature, run for this page no extensionNonDuplicatedItems
(no comment in the source: the name reads as a sentence) non duplicated itemsin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.NonDuplicatedItems() )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page QCSXTZZZIBWU NumberOfNonDuplicatedItems
(no comment in the source: the name reads as a sentence) number of non duplicated itemsin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfNonDuplicatedItems()
#--> 3
composed from the signature, run for this page QCSXTZZZIBWU FindNonDuplicatedItems
(no comment in the source: the name reads as a sentence) find non duplicated itemsin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNonDuplicatedItems() )
#--> [ 1, 3, 5 ]
composed from the signature, run for this page QCSXTZZZIBWU NonDuplicatedItemsAndTheirPositions
(no comment in the source: the name reads as a sentence) non duplicated items and their positionsin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.NonDuplicatedItemsAndTheirPositions() )
#--> [ [ 5, 1 ], [ 8, 3 ], [ 1, 5 ] ]
composed from the signature, run for this page QCSXTZZZIBWU NListify
N-LISTIFY (pad each item into an n-element sublist)QCSXTZZZIBWU
NListified
(no comment in the source: the name reads as a sentence) n listifiedin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.NListified(2) )
#--> [ [ 5, "" ], [ 3, "" ], [ 8, "" ], [ 3, "" ], [ 1, "" ] ]
composed from the signature, run for this page no extension FirstHalfAndPosition
(no comment in the source: the name reads as a sentence) first half and positionalso written: FirstHalfAndItsPositionin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FirstHalfAndPosition() )
#--> [ [ 5, 3 ], 1 ]
composed from the signature, run for this page QCSXTZZZIBWU FirstHalfAndSection
(no comment in the source: the name reads as a sentence) first half and sectionalso written: FirstHalfAndItsSectionin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FirstHalfAndSection() )
#--> [ [ 5, 3 ], [ 1, 2 ] ]
composed from the signature, run for this page QCSXTZZZIBWU SecondHalfAndPosition
(no comment in the source: the name reads as a sentence) second half and positionalso written: SecondHalfAndItsPositionin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SecondHalfAndPosition() )
#--> [ [ 8, 3, 1 ], 3 ]
composed from the signature, run for this page QCSXTZZZIBWU SecondHalfAndSection
(no comment in the source: the name reads as a sentence) second half and sectionalso written: SecondHalfAndItsSectionin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.SecondHalfAndSection() )
#--> [ [ 8, 3, 1 ], [ 3, 5 ] ]
composed from the signature, run for this page QCSXTZZZIBWU Halves
(no comment in the source: the name reads as a sentence) halvesin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Halves() )
#--> [ [ 5, 3 ], [ 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWU HalvesAndPositions
(no comment in the source: the name reads as a sentence) halves and positionsin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.HalvesAndPositions() )
#--> [ [ [ 5, 3 ], 1 ], [ [ 8, 3, 1 ], 3 ] ]
composed from the signature, run for this page QCSXTZZZIBWU HalvesAndSections
(no comment in the source: the name reads as a sentence) halves and sectionsin the section monolith -- split-dropped, authoritative semantics).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.HalvesAndSections() )
#--> [ [ [ 5, 3 ], [ 1, 2 ] ], [ [ 8, 3, 1 ], [ 3, 5 ] ] ]
composed from the signature, run for this page QCSXTZZZIBWU IsNeither
allitemsareequalto (split-dropped / new).
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsNeither([ 2, 3 ], [ 2, 3 ])
#--> 1
composed from the signature, run for this page QCSXTZZZIBWUHasSameContent: order-INsensitive content equality (a multiset -- comparison). Same items, any order, optionally case-folded.
1 examples run? Q([ "I", "B", "M" ]).HasSameContent( :As = [ "B", "M", "I" ] )
? Q([ "I", "B", "M" ]).HasSameContentCS( :As = [ "b", "m", "i" ], :CS = FALSE )
#--> 1
#--> 1
library testQCSXTZZZIBWUFirst sublist (item that is itself a list) and its position.
1 examples runo1 = new stzList([ "A", "B", 1:3, "C", "D", 4:5 ])
? o1.FirstList()
? o1.FindFirstList()
#--> 1
#--> 2
#--> 3
#--> 3
library testno extensionallitemsareequalto (split-dropped / new).
1 examples runo1 = new stzList([ "A", "B", 1:3, "C", "D", 4:5 ])
? o1.FirstList()
? o1.FindFirstList()
#--> 1
#--> 2
#--> 3
#--> 3
library testno extensionSame as AllItemsAreEqualToCS: AllItemsAreEqualTo: every item equals pItem (content-compare, so -- sublists match too).
1 examples runo1 = new stzList([ 1, 1, 1 ])
? o1.AllItemsAreEqualTo(1)
#--> 1
library testQCSXTZZZIBWUFindNumbers
The positions of the NUMBER items.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNumbers() )
#--> [ 1, 2, 3, 4, 5 ]
composed from the signature, run for this page QCSXTZZZIBWUFindNonNumbers
The positions of the non-number items.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.FindNonNumbers() )
#--> [ 1, 2, 3, 4 ]
composed from the signature, run for this page no extensionRemoveNumbers
Remove all the number items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveNumbers()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionRemoveOnlyNumbers
Same as RemoveNumbers: Remove all the number items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveOnlyNumbers()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionRemoveAllExceptNonNumbers
Same as RemoveNumbers: Remove all the number items (mutating).
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.RemoveAllExceptNonNumbers()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page no extensionRemoveNonNumbers
Remove every non-number item (mutating).no extension
RemoveOnlyNonNumbers
Same as RemoveNonNumbers: Remove every non-number item (mutating).no extension
RemoveAllExceptNumbers
Same as RemoveNonNumbers: Remove every non-number item (mutating).no extension
NumberOfOccurrenceOfItems
Same as NumberOfOccurrenceOfItemsCS: Occurrence counts: each distinct item paired with how many times -- it appears.
also written: NumberOfOccurrenceOfEachItemcomposed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.NumberOfOccurrenceOfItems() )
#--> [ [ 5, 1 ], [ 3, 2 ], [ 8, 1 ], [ 1, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUTRUE if every item is a number or a pair of numbers.
1 examples runo1 = new stzList([ 0, 2, 0, 3, [1,2] ])
? o1.IsListOfNumbersAndPairsOfNumbers()
#--> 1
library testno extensionSplitAfterPositions
Split the list after EACH of the given positions.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SplitAfterPositions([ 2, 3 ])
? @@( o1.Content() )
#--> [ [ 5, 3 ], [ 8 ], [ 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUThe parts split after the given positions, as data.
1 examples runo1 = new stzList([ "a", "b", "c", "d", "e" ])
? @@( o1.SplittedToPartsOfNItemsXT(2) ) + NL
? @@( o1.SplittedAfterPositions([ 3, 5 ]) ) + NL
? @@( o1.SplittedBeforePositions([ 3, 5 ]) )
#--> [ [ "a", "b" ], [ "c", "d" ], [ "e" ] ]
#--> [ [ "a", "b", "c" ], [ "d", "e" ] ]
#--> [ [ "a", "b" ], [ "c", "d" ], [ "e" ] ]
library testno extensionSplitBeforePositions
Split the list before EACH of the given positions.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.SplitBeforePositions([ 2, 3 ])
? @@( o1.Content() )
#--> [ [ 5 ], [ 3 ], [ 8, 3, 1 ] ]
composed from the signature, run for this page QCSXTZZZIBWUThe parts split before the given positions, as data.
1 examples runo1 = new stzList([ "a", "b", "c", "d", "e" ])
? @@( o1.SplittedToPartsOfNItemsXT(2) ) + NL
? @@( o1.SplittedAfterPositions([ 3, 5 ]) ) + NL
? @@( o1.SplittedBeforePositions([ 3, 5 ]) )
#--> [ [ "a", "b" ], [ "c", "d" ], [ "e" ] ]
#--> [ [ "a", "b", "c" ], [ "d", "e" ] ]
#--> [ [ "a", "b" ], [ "c", "d" ], [ "e" ] ]
library testno extensionSame as FindNthPreviousOccurrenceCS: Nth previous occurrence (scanning backward from a start position).
1 examples runalso written: PreviousNthOccurrenceo1 = new stzList( [ 0, 8, 0, 0, 1, 8, 0, 0 ] )
? o1.PreviousNthOccurrence(2, :Of = 0, :StartingAt = 5)
? o1.PreviousNthOccurrence(2, :Of = 8, :StartingAt = :LastItem)
#--> 3
#--> 2
library testQCSXTZZZIBWUSame as RemoveTheseBoundsCS: Remove a matching opening/closing bound pair (e.g. "{" ... "}"). -- TheseBoundsRemoved returns a fresh list; RemoveTheseBounds mutates.
1 examples runo1 = new stzList([ "{", "A", "B", "C", "}" ])
? o1.IsBoundedBy([ "{", "}" ]) + NL
o1.RemoveTheseBounds("{", "}")
? o1.Content()
#--> 1
#--> A
#--> B
#--> Clibrary testQCSXTZZZIBWUA copy with the two given bounds removed from the ends.
2 examples runo1 = new stzList([ "{", "A", "B", "C", "}" ])
? o1.TheseBoundsRemoved("{", "}")
#--> A
#--> B
#--> Clibrary testno extensionMultiply the list by the given factor (number: tile; list: pairwise).
1 examples runno extensionThe positions of the stzNumber OBJECT items.
1 examples runo1 = new stzList([ Q("one"), Q(1), Q("two"), Q(2), Q("three"), Q(3), Q(1:2), NullObject() ])
? @@( o1.FindStzNumbers() )
? @@( o1.FindStzStrings() )
? @@( o1.FindStzLists() )
? @@( o1.FindStzObjects() )
#--> [ 2, 4, 6 ]
#--> [ 1, 3, 5 ]
#--> [ 7 ]
#--> [ 1, 2, 3, 4, 5, 6, 7, 8 ]library testno extensionSame as ReplaceThisItemAt: positional replacers (ported from the monolith)
1 examples runo1 = new stzList([ "♥", 2, "♥", "♥", 5 ])
o1.ReplaceAt([2, 5], "♥") # Or ReplaceAnyAt()
? @@( o1.Content() )
o1.ReplaceThisAt(3, "♥", 3)
? @@( o1.Content() )
#--> [ "♥", "♥", "♥", "♥", "♥" ]
#--> [ "♥", "♥", 3, "♥", "♥" ]
library testno extensionReplaceAnyAt
Same as ReplaceAt: Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.no extension
Positions of items that are stz objects of a given kind.
1 examples runo1 = new stzList([ Q("one"), Q(1), Q("two"), Q(2), Q("three"), Q(3), Q(1:2), NullObject() ])
? @@( o1.FindStzNumbers() )
? @@( o1.FindStzStrings() )
? @@( o1.FindStzLists() )
? @@( o1.FindStzObjects() )
#--> [ 2, 4, 6 ]
#--> [ 1, 3, 5 ]
#--> [ 7 ]
#--> [ 1, 2, 3, 4, 5, 6, 7, 8 ]library testno extensionThe positions of the stzList OBJECT items.
1 examples runo1 = new stzList([ Q("one"), Q(1), Q("two"), Q(2), Q("three"), Q(3), Q(1:2), NullObject() ])
? @@( o1.FindStzNumbers() )
? @@( o1.FindStzStrings() )
? @@( o1.FindStzLists() )
? @@( o1.FindStzObjects() )
#--> [ 2, 4, 6 ]
#--> [ 1, 3, 5 ]
#--> [ 7 ]
#--> [ 1, 2, 3, 4, 5, 6, 7, 8 ]library testno extensionToStzListOfStrings
Convert to a stzListOfStrings (for string-oriented chaining like -- ConcatenatedUsing / Joined). Needed by the ..Q() chain idioms.no extension
InsertAfter(:ItemAtPosition = n, item): NON-mutating -- returns the -- would-be list with item inserted after position n, leaving This as-is -- (use InsertAfterPosition for the mutating form).
3 examples runo1 = new stzList([ "A1", "A2", "A3" ])
o1.InsertAfter( :ItemAtPosition = 3, "A4" )
? o1.Content()
#--> A1
#--> A2
#--> A3
library testQCSXTZZZIBWUWFUppercaseQ
UppercaseQ: uppercase every string item in place, return This for -- chaining (mirrors LowercaseQ; relies on Uppercased).no extension
LowercaseQ
Lowercase every string item, chainable.no extension
AddedItemsComparedToCS
(no comment in the source: the name reads as a sentence) added items compared to csin the section from the monolith (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.AddedItemsComparedToCS([ 2, 3 ], TRUE) )
#--> [ 2 ]
composed from the signature, run for this page no extension RemovedItemsComparedToCS
(no comment in the source: the name reads as a sentence) removed items compared to csin the section from the monolith (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.RemovedItemsComparedToCS([ 2, 3 ], TRUE) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page no extension ModifiedItemsComparedToCSXT
(no comment in the source: the name reads as a sentence) modified items compared to csxtin the section from the monolith (split-dropped).no extension
Objectify
Objectify: wrap each item in a Q() stz object (so per-item stz -- methods like ContainsCS can be called). Needed by DiffXTT's -- similarity matching.QCSXTZZZIBWU
Objectified
(no comment in the source: the name reads as a sentence) objectifiedin the section from the monolith (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Objectified() )
#--> [ @noname, @noname, @noname, @noname, @noname ]
composed from the signature, run for this page no extension IsQuietEqualTo: approximate equality. Exact-equal (engine-backed -- IsEqualTo) OR the length-difference ratio is below the tunable -- QuietEqualityRatio (default 0.09; SetQuietEqualityRatio to change). -- No element loop here -- the content compare is the engine's job.
1 examples runo1 = new stzList([ "f","a","y","e","d" ])
? o1.IsQuietEqualTo([ "a","l", "f", "a","y","e","d" ])
? QuietEqualityRatio()
SetQuietEqualityRatio(0.41)
? o1.IsQuietEqualTo([ "a","l", "f", "a","y","e","d" ])
#--> 0
#--> 0.09
#--> 1
library testno extensionDeepContainsThese
Same as DeepContainsManyCS: Deep "contains" combinators. The heavy work is DeepContainsCS -- (engine-backed: stringify the whole list + StzFind). These just -- loop over the small QUERY list, not the data -- so no data-loop.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.DeepContainsThese([ 2, 3 ])
#--> 0
composed from the signature, run for this page no extension(no comment in the source: the name reads as a sentence) deep contains both 1 examples runin the section from the monolith (split-dropped).QCSXTZZZIBWU (no comment in the source: the name reads as a sentence) deep contains one of these 1 examples runin the section from the monolith (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.DeepContainsOneOfThese([ 2, 3 ])
#--> 1
composed from the signature, run for this page QCSXTZZZIBWU (no comment in the source: the name reads as a sentence) deep contains n of these 1 examples runin the section from the monolith (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.DeepContainsNOfThese(2, [ 2, 3 ])
#--> 0
composed from the signature, run for this page QCSXTZZZIBWU ToListOfStzStrings
tion over the established per-string locale lookups.
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.ToListOfStzStrings() )
#--> [ @noname, @noname, @noname, @noname ]
composed from the signature, run for this page no extensiontion over the established per-string locale lookups.
1 examples run? Q([ :ar, :en, :fr ]).AreLanguageAbbreviations()
#--> 1
library testno extensiontion over the established per-string locale lookups.
1 examples runo1 = new stzList([ :Language = "arabic", :Country = "tn", :Script = "arabic" ])
? o1.IsLocaleList() + NL
o1 = new stzList([ :Language = "ar", :Country = "TN", :script = "arabic" ])
? o1.IsLocaleList() + NL
? StringIsScriptName("latin")
#--> 1
#--> 1
#--> 1library testno extensiontion over the established per-string locale lookups.
1 examples runo1 = new stzList([ :english = "house", :french = "maison", :arabic = "منزل" ])
? o1.IsMultilingualString()
o1 = new stzList([ :en = "house", :fr = "maison", :ar = "منزل" ])
? o1.IsMultilingualString()
#--> 1
#--> 1
library testno extensionReplaceRepeatedLeadingItem
Replace the run of repeated LEADING items with a given value -- (:with names it). Delegates to ReplaceLeadingItems.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
o1.ReplaceRepeatedLeadingItem(3)
? @@( o1.Content() )
#--> [ 3, 3, 8, 3, 1 ]
composed from the signature, run for this page no extensionWalkBackAndForth
(no comment in the source: the name reads as a sentence) walk back and forthin the section sequences (arithmetic); itemsat does the gather.composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkBackAndForth() )
#--> [ 5, 4, 3, 2, 1, 2, 3, 4, 5 ]
composed from the signature, run for this page QCSXTZZZIBWU WalkNItemsForwardXT
N-step (every nth item)no extension
WalkNItemsBackwardXT
(no comment in the source: the name reads as a sentence) walk n items backward xtin the section sequences (arithmetic); itemsat does the gather.no extension
WalkNProgressiveItemsForward
(no comment in the source: the name reads as a sentence) walk n progressive items forwardalso written: WalkNMoreForwardin the section sequences (arithmetic); itemsat does the gather.composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNProgressiveItemsForward(2) )
#--> [ 1, 3 ]
composed from the signature, run for this page QCSXTZZZIBWU WalkNProgressiveItemsBackward
(no comment in the source: the name reads as a sentence) walk n progressive items backwardalso written: WalkNMoreBackwardin the section sequences (arithmetic); itemsat does the gather.composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNProgressiveItemsBackward(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page QCSXTZZZIBWU WalkNItemsForwardNItemsBackward
(no comment in the source: the name reads as a sentence) walk n items forward n items backwardalso written: WalkForwardBackwardin the section walk zigzag + start/end family (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNItemsForwardNItemsBackward(2, 5) )
#--> [ 4 ]
composed from the signature, run for this page QCSXTZZZIBWU WalkNItemsBackwardNItemsForward
walking n items forward and n items backward
also written: WalkBackwardForwardin the section walk zigzag + start/end family (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNItemsBackwardNItemsForward(2, 5) )
#--> [ 3 ]
composed from the signature, run for this page QCSXTZZZIBWUWalkNItemsFromStartNItemsFromEnd
walking n steps from start and n steps from end
also written: WalkNStartNEndin the section walk zigzag + start/end family (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNItemsFromStartNItemsFromEnd(2, 5) )
#--> [ 1 ]
composed from the signature, run for this page QCSXTZZZIBWUWalkNItemsFromEndNItemsFromStart
walking n steps from start and n steps from end
also written: WalkNEndNStartin the section walk zigzag + start/end family (split-dropped).composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.WalkNItemsFromEndNItemsFromStart(2, 5) )
#--> [ 5, 3, 1, 2 ]
composed from the signature, run for this page QCSXTZZZIBWU