Softanza
StartFrançais
Softanza
The library documents itself · Collections & objects

stzList

887 own methods · 514 forms written with extensions, listed under their method

also named: stzItems

the source: base/list/stzList.ring(opens in a new tab) · All classes · The area reference: Collections & objects

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 testQCSXTZZZIBWU
Copy
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 list
composed 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 list
o1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
library testQCSXTZZZIBWUWF
NumberOfItemsB
(no comment in the source: the name reads as a sentence) number of items bin the section getting the number of items of the list
composed 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 run
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Items() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page
QCSXTZZZIBWUWFExcept
getting the nth item in the list 2 examples runalso written: ItemAt · NthItem · ItemAtPosition
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Item(2)
#--> 3
composed from the signature, run for this page
QCSXTZZZIBWUWF
FirstItem
getting the first item in the listalso named: head front first element the top beginning item
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FirstItem()
#--> 5
composed from the signature, run for this page
QCSXTZZZIBWUWF
LastItem
getting the last item in the listalso named: tail back last element the end final item
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.LastItem()
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWUWF
FirstAndLastItems
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 extension
LastAndFirstItems
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 extension
CentralPosition
getting the central position in the listalso written: CentralItemPosition
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CentralPosition()
#--> 2
composed from the signature, run for this page
no extension
CentralItem
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
QCSXTZZZIBWU
HasCentralItem
checking if the string has a central itemalso written: ContainsCentralItem
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasCentralItem()
#--> 1
composed from the signature, run for this page
no extension
NFirstItems
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
QCSXTZZZIBWUQRT
NLastItems
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
QCSXTZZZIBWUQRT
getting next/previous n items from a position 1 examples runno extension
Replace the whole content with the given list (mutating; the enforcement guard sits at _SetContent, the single update point). 1 examples run
o1 = new stzList("A":"E")
o1.Update([])
? @@( o1.Content() )
#--> [ ]
library testQCSXTZZZIBWU
UpdateWith
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
QCSXTZZZIBWU
UpdateBy
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
QCSXTZZZIBWU
Updated
The value the list would be updated to (the passive twin of Update).also written: UpdatedBy · UpdatedWith
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Updated([ 2, 3 ]) )
#--> [ 2, 3 ]
composed from the signature, run for this page
no extension
AddItem
Add the given item at the end of the list (mutating).also named: append push add element put at the end
composed 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
QCSXTZZZIBWU
Add
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 back
composed 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
QCSXTZZZIBWUMany
Append
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
QCSXTZZZIBWU
ItemAdded
A copy of the list with the item appended; the original is unchanged.also written: Added
composed 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 extension
ManyAdded
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 extension
MergeWith
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
QCSXTZZZIBWUMany
MergedWith
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
QCSXTZZZIBWUMany
adding an item at a given position --> insert or extend 2 examples run
o1 = new stzList(1:5)
o1.AddItemAt(8, 9)
? @@( o1.Content() )
#--> [ 1, 2, 3, 4, 5, "", "", 9 ]
library testQCSXTZZZIBWU
AddItems
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 extension
TRUE 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 extension
IsNotEmpty
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 extension
IsNamedParam
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 run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AllItemsAreEqual()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
AllAreEqual
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
QCSXTZZZIBWU
IsWithRowNamedParam
(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 · ToListInString
o1 = new stzList([ "A", "b", "C", "B", '"B",', "D", "E" ])
? o1.ToCode()
#--> [ "A", "b", "C", "B", '"B",', "D", "E" ]
library testQCSXTZZZIBWU
ToString
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
QCSXTZZZIBWU
Show
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 extension
StzType
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 extension
Replace
(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
QCSXTZZZIBWU
ReplacePreviousNthOccurrence
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
QCSXTZZZIBWU
ReplaceFirst
(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 run
o1 = new stzList([ "A", "B", "*", "D", "*",  "=" ])
o1.ReplaceManyByMany([ "*", "=" ], :With = ["C", "F"])
? @@( o1.Content() )
#--> [ "A", "B", "C", "D", "C", "F" ]
library testQCSXTZZZIBWU
ReplaceSection: 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 run
o1 = new stzList([ "1", "2", "_", "_", "_", "4", "5" ])
o1.ReplaceSection(3, 5, :With = "3")
? @@( o1.Content() )
#--> [ "1", "2", "3", "4", "5" ]
library testQCSXTZZZIBWU
Same 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 run
o1 = new stzList([ "A", "B", "C", "1", "2", "3", "D", "E" ])
o1.ReplaceSectionByMany(4, 6, [ "*", "*", "*", "*" ])
? @@( o1.Content() )
#--> [ "A", "B", "C", "*", "*", "*", "*", "D", "E" ]
library testQCSXTZZZIBWU
Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming. 5 examples run
o1 = new stzList([ "A", "a", "A" ])
o1.ReplaceAt(2, :By = "A")
? o1.Content()
#--> A
#--> A
#--> A
library testQCSXTZZZIBWU
UpdateAt
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 extension
SetItemAt
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 extension
Same as ReplaceAt: Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming. 1 examples run
o1 = new stzList([ 1, 2, "♥", 4, "♥" ])
o1.ReplaceAnyItemAt(3, :With = "★")
? @@( o1.Content() )
#--> [ 1, 2, "★", 4, "♥" ]
library testno extension
ReplaceItemAtPosition
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 extension
ReplaceAnyItemAtPositions
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 extension
ReplaceAnyItemsAtPositions
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 extension
ReplaceItemsAtPositions
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 extension
ReplaceAtPositions
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 extension
ReplaceThisItemAtPositions
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 extension
positional replacers (ported from the monolith) 2 examples run
o1 = 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 extension
ReplaceTheseItemsAtPositions
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 extension
Same as ReplaceByManyCS: Replace the k-th occurrence of pItem with paNewItems[k] (in order). 1 examples run
o1 = new stzList([ "♥", 2, "♥", "♥", 5, "♥" ])
o1.ReplaceByMany("♥", [ 1, 3, 4, 6 ])
? @@( o1.Content() )
#--> [ 1, 2, 3, 4, 5, 6 ]
library testQCSXTZZZIBWU
ReplaceItemByManyXT
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 extension
Replace items at the GIVEN positions with paNewItems consumed in order. 2 examples run
o1 = new stzList([ "A", "B", "*", "D", "*",  "=" ])
o1.ReplaceOccurrencesByMany([ 3, 5, 6 ], ["C", "E", "F"])
? @@( o1.Content() )
#--> [ "A", "B", "C", "D", "E", "F" ]
library testQCSXTZZZIBWU
Same as ReplaceItemAtPositionsByManyCS: At the panPos that hold pItem, replace the k-th such with paNewItems[k]. 1 examples run
o1 = new stzList([ "♥", 2, "♥", "♥", 5 ])
o1.ReplaceItemAtPositionsByMany([1, 3, 4 ], "♥", [ 1, 3, 4 ])
? @@( o1.Content() )
#--> [ 1, 2, 3, 4, 5 ]
library testQCSXTZZZIBWU
ReplaceTheseItemsAtPositionsByMany
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
QCSXTZZZIBWU
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.ReplaceAnyItemAtPositionsByMany([ 2, 3 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ 5, 2, 3, 3, 1 ]
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceAnyItemsAtPositionsByMany
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
QCSXTZZZIBWU
Same as ReplaceAnyItemAtPositionsByManyXT: Same as ReplaceAnyItemAtPositionsByManyCSXT: XT: cycle news across ALL given positions. 1 examples run
o1 = new stzList([ "_", "_", "3", "4", "5", "6", "7", "_", "_" ])
o1.ReplaceAtByManyXT(3:5, [ "-3", "-4", "-5" ])
? @@( o1.Content() )
#--> [ "_", "_", "-3", "-4", "-5", "6", "7", "_", "_" ]
library testno extension
ReplaceItemsW
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 run
composed 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
QCSXTZZZIBWUST
ReplaceNthNextOccurrenceST
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 extension
stringifying the list (all items are forced to become strings) 2 examples run
o1 = new stzList([ 120, "abc", 1:3 ])
o1.Stringify()
# stringifying_the_items_of_a_list example 1
? @@( o1.Content() )
#--> [ "120", "abc", "[ 1, 2, 3 ]" ]
library testQCSXTZZZIBWU
ToListInAString: 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 extension
Short form: a contiguous run of integers (a, a+1, ..., b -- or the descending a, a-1, ..., b) collapses to the range literal "a:b". Anything else falls back to the full stringified list. 2 examples runalso written: ToListInShortForm · ToListInStringInShortForm
? StzListQ( 4:8 ).ToListInString()
? StzListQ( 4:8 ).ToListInStringInShortForm()
#--> [ 4, 5, 6, 7, 8 ]
#--> 4:8
library testno extension
StringifyAndReplace: 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 run
o1 = new stzList([ "--_--", [ 12, "--_--", 10], "--_--", 9 ])
o1.StringifyAndReplace("_", "♥")
? @@( o1.Content() )
#--> [ "--♥--", '[ 12, "--♥--", 10 ]', "--♥--", "9" ]
library testQCSXTZZZIBWU
StringifyLowercase
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 runQCSXTZZZIBWU
StringifyUppercaseAndReplace
stringify delegation (via stzliststringify)QCSXTZZZIBWU
contains delegations (via stzlistcomparator) 2 examples runalso written: IsMadeOfAnyOfThese · IsMadeOfOneOfThese
o1 = new stzList([ :monday, :monday, :monday ])
? o1.IsMadeOfOneOfThese([ :sunday, :monday, :saturday, :wednesday, :thirsday, :friday, :saturday ])
#--> 1
library testQCSXTZZZIBWU
contains delegations (via stzlistcomparator) 1 examples run
o1 = 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
#--> 1
library testQCSXTZZZIBWU
contains delegations (via stzlistcomparator) 1 examples run
composed 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 run
o1 = new stzList([ "a", "abcde", "abc", "ab", "abcd" ])
o1.SortBy('len(@item)')
# sortby example 1
? @@( o1.Content() )
#--> [ "a", "ab", "abc", "abcd", "abcde" ]
library testQCSXTZZZIBWU
SortByDescending
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 extension
non-mutating: return the sorted-by-key copy 1 examples run
o1 = new stzList([ "programming", "is" ])
# sortedby example 1
? @@( o1.SortedBy('len(@item)') )
#--> [ "is", "programming" ]
library testno extension
SortUp
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
QCSXTZZZIBWU
SortDown
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
QCSXTZZZIBWU
Sort 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 testQCSXTZZZIBWU
Word-order aliases used by narrative tests. 1 examples run
o1 = 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 testQCSXTZZZIBWU
SortAscending
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
QCSXTZZZIBWU
An ascending-sorted copy of the list; the original is unchanged. 3 examples runalso written: SortedInAscending · ItemsSortedInAscending
o1 = new stzList([ 5, 7, 9, 2 ])
? o1.SortedInAscending()
#--> 2
#--> 5
#--> 7
#--> 9
library testQCSXTZZZIBWU
SortInDescending
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
QCSXTZZZIBWU
Same as SortedInDescendingCS: A descending-sorted copy of the list; the original is unchanged. 1 examples run
o1 = 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 testQCSXTZZZIBWU
Reverse the order of the items in place (mutating). For a copy, use Reversed. 1 examples runalso named: flip backwards invert order last to first
composed 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
QCSXTZZZIBWU
A reversed copy of the list; the original is unchanged. 2 examples runalso written: ItemsReversed
o1 = new stzList(1:3)
? o1.Reversed()
#--> 3
#--> 2
#--> 1
library testno extension
Every item except those equal to p (p may be a single item). 2 examples run
o1 = new stzList([ "A", "B", "_", "C", "D", "E", "F" ])
? @@( o1.AllItemsExcept("_") )
#--> [ "A", "B", "C", "D", "E", "F" ]
library testno extension
First n items (clamped to the list length; n<=0 -> empty). 2 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FirstNItems(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page
QCSXTZZZIBWUQRT
Max nesting depth (a flat list is 1 level). 1 examples runalso written: NestingDepth
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfLevels()
#--> 1
composed from the signature, run for this page
no extension
TRUE if any two adjacent items are equal. 1 examples runalso written: ContainsConsecutiveDuplicates
o1 = new stzList([ "A", "B", "C" ])
# containsdupsecutiveitems example 1
? @@( o1.ContainsDupSecutiveItems() )
#--> 0
library testno extension
ManyRemoved
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 extension
TRUE 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 run
o1 = new stzList([ "a", "c" ])
? o1.ItemsHaveSameOrderAs([ "a", "c", "f" ])
#--> 1
library testno extension
TRUE if the list contains the given item. 9 examples runalso named: includes has is in member of present holds
o1 = new stzList("a":"t")
? o1.Contains("x")
#--> 0
library 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 testQCSXTZZZIBWU
ToStzListOfCharsQ
(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 · ContainsDuplicates
oW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
? oW.NumberOfDuplicates()
#--> 1
#--> 3
library testQCSXTZZZIBWU
The items that occur more than once in the list. 12 examples runalso named: repeated items doubles occur twice duplicatesalso written: DupOrigins · Duplicates · Duplications · DuplicatedStrings
o1 = new stzList([ 5, 7, 5, 5, 4, 7, 1 ])
? o1.Duplicates()
? o1.FindDuplicates()
#--> 5
#--> 7
#--> 3
#--> 4
#--> ...
library testQCSXTZZZIBWU
NumberOfDuplicatedItems
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
QCSXTZZZIBWU
NumberOfDuplicates 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 · NumberOfDuplications
oW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
? oW.NumberOfDuplicates()
#--> 1
#--> 3
library testQCSXTZZZIBWU
The position of every 2nd+ occurrence of each duplicated item. 5 examples runalso written: FindDuplications · FindDuplicatedItems
o1 = new stzList([ 5, 7, 5, 5, 4, 7, 1 ])
? o1.Duplicates()
? o1.FindDuplicates()
#--> 5
#--> 7
#--> 3
#--> 4
#--> ...
library testQCSXTZZZIBWU
DuplicateItemsZ
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 extension
FindNextNthItem(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 run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextNthItem(2, 5)
#--> 0
composed from the signature, run for this page
no extension
The nth item after the given position. 1 examples runno extension
FindPreviousNthItem(n, :StartingAt = pos): the POSITION of the n-th item counting BACK from pos inclusive (pos-n+1). 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindPreviousNthItem(2, 5)
#--> 4
composed from the signature, run for this page
no extension
The nth item before the given position. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.PreviousNthItem(2, 5)
#--> 3
composed from the signature, run for this page
no extension
FindDuplicatesOfString
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
QCSXTZZZIBWU
FindDuplicatesOfItem
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
QCSXTZZZIBWU
FindDuplicationsOfItem
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
QCSXTZZZIBWU
FindDuplicationsOf
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 extension
NumberOfDuplicatesOfString
(no comment in the source: the name reads as a sentence) number of duplicates of stringin the section duplicates of a specific item / string
composed 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 / string
composed 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 / string
composed 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 / string
composed 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
QCSXTZZZIBWU
FindDuplicatedItem
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
QCSXTZZZIBWU
ContainsDuplicatedString
(no comment in the source: the name reads as a sentence) contains duplicated stringin the section duplicates of a specific item / string
composed 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 / string
composed 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 / string
composed 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 · FindTheseContiguousItems
o1 = new stzList([ 1, 2, 3, 4, "|", 2, 3, 4, 5, "|", 2, 3, 4, 5 ])
? o1.FindSubList([ 2, 3, 4 ])
#--> 2
#--> 6
#--> 11
library testQCSXTZZZIBWU
ContainsSubList
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
QCSXTZZZIBWU
Merge: 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 run
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.Merge()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page
QCSXTZZZIBWU
A 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 extension
Flatten 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 nesting
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
o1.Flatten()
? @@( o1.Content() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page
QCSXTZZZIBWU
A 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 extension
equality check (set-based, engine-backed) 5 examples run
o1 = new stzList([ "C", "A", "B" ])
? o1.IsEqualTo([ "A", "B", "C" ])
? o1.IsEqualToXT([ "A", "B", "C" ])
#--> 1
#--> 0
library testQCSXTZZZIBWU
strict equality (same items + same positions) 3 examples runalso written: IsIdenticalTo
o1 = new stzList([ 1, 2, 3 ])
? o1.IsEqualTo([ 3, 1, 2 ])
? o1.IsStrictlyEqualTo([ 3, 1, 2 ])
? o1.IsStrictlyEqualTo([ 1, 2, 3 ])
#--> 1
#--> 0
#--> 1
library testQCSXTZZZIBWU
StartsWith
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
QCSXTZZZIBWU
EndsWith
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
QCSXTZZZIBWU
expression-backed operations (engine bytecode) 2 examples runalso written: Yield
composed 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
QCSXTZZZIBWUWF
Filter
expression-backed operations (engine bytecode)also named: keep where select subset matching items pick out
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Filter("@item > 3") )
#--> [ 5, 8 ]
composed from the signature, run for this page
QCSXTZZZIBWUWF
Reduce(): 0-arg auto-concat / auto-sum. - All-string items: concatenate. - All-number items: sum. - Mixed: concatenate stringified items. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Reduce()
#--> 20
composed from the signature, run for this page
QCSXTZZZIBWU
expression-backed operations (engine bytecode) 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ReduceNoInit("@item > 3")
#--> 0
composed from the signature, run for this page
no extension
CountWhere
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")
#--> 2
composed from the signature, run for this page
no extension
CountItemsW
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")
#--> 2
composed from the signature, run for this page
no extension
IsSorted
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 extension
TRUE if the items are in ascending order. 1 examples run
o1 = new stzList([ 3, 6, 9, 12, "a", "b", [ "List0" ], [ "List1" ] ])
? o1.IsSortedInAscending()
#--> 1
library testno extension
IsSortedInDescending
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 extension
SortingOrder
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 extension
TRUE 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 extension
HasSameContentAs: 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 · IsEquivalentTo
o1 = new stzList([ "a", "c", 12 ])
? o1.HasSameContentAs([ "a", 12, "c" ])
#--> 1
library testno extension
TRUE if every item is a [key, value] pair (a hash list). 1 examples runalso written: IsAHashList
aList = [ :name = "mansour", :job = "programmer", :name = "xe" ]
o1 = new stzList(aList)
? o1.IsHashList()
#--> 0
library testno extension
IsNotHashList
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 extension
ToStzHashList
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: IsAPair
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsPair()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
TRUE 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 extension
An 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 extension
IsLowercase
type-checking methodsalso written: AllItemsAreLowercase
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsLowercase()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the list is non-empty and every item is a number. 1 examples runalso written: IsAListOfNumbers
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfNumbers()
#--> 1
composed from the signature, run for this page
no extension
TRUE 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 extension
Polymorphic membership test: IsListOf(:Numbers/:Strings/:Chars/ :Lists/:StzNumbers/:StzStrings/:ListsOfNumbers/:PairsOfNumbers). 2 examples runalso written: IsAListOfno extension
IsListOfLists
TRUE if every item is a list (vacuously TRUE when empty).also written: IsAListOfLists · AllItemsAreLists · ContainsOnlyLists
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfLists()
#--> 0
composed from the signature, run for this page
no extension
IsListOfListsOfNumbers
IsListOfListsOfNumbers: each top-level item must be a list, and each inner item must be a number.also written: IsAListOfListsOfNumbers
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfListsOfNumbers()
#--> 0
composed from the signature, run for this page
no extension
IsListOfListsOfSameSize
TRUE if every item is a list and all the sublists have the same size.also written: ItemsAreListsOfSameSize · AllItemsAreListsOfSameSize
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfListsOfSameSize()
#--> 0
composed from the signature, run for this page
no extension
IsPairOfNumbers
TRUE if the list is exactly a pair of two numbers.also written: IsAPairOfNumbers
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsPairOfNumbers()
#--> 0
composed from the signature, run for this page
no extension
IsListOfPairs
TRUE if every item is a pair (vacuously TRUE when empty).also written: IsAListOfPairs
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfPairs()
#--> 0
composed from the signature, run for this page
no extension
IsContiguous
True iff the list of numbers is sorted ascending with consecutive values (e.g. [3,4,5] -> TRUE, [3,5,6] -> FALSE).also written: AreContiguous
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsContiguous()
#--> 0
composed from the signature, run for this page
no extension
IsListOfPairsOfNumbers
TRUE if every item is a pair of numbers.also written: IsAListOfPairsOfNumbers
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfPairsOfNumbers()
#--> 0
composed from the signature, run for this page
no extension
IsListOfPairsOfStrings
TRUE if every item is a pair of strings.also written: IsAListOfPairsOfStrings
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsListOfPairsOfStrings()
#--> 0
composed from the signature, run for this page
no extension
IsSet
TRUE if all the items are unique (the list is a set).also written: IsASet
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsSet()
#--> 0
composed from the signature, run for this page
no extension
List
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
QCSXTZZZIBWU
Same as SectionCS: Section: extract items between two positions 3 examples run
o1 = new stzList(1:10)
# section example 1
? @@( o1.Section(3, 10) )
#--> [ 3, 4, 5, 6, 7, 8, 9, 10 ]
library testQCSXTZZZIBWU
Range: extract items from a start position for a given count 1 examples runQCSXTZZZIBWU
InsertAt: insert an item at a given position 1 examples run
o1 = new stzList([ "A", "C", "D" ])
o1.InsertAt(2, "B")
? o1.Content()
#--> A
#--> B
#--> C
#--> D
library testQCSXTZZZIBWU
Same as InsertAt: InsertAt: insert an item at a given position 1 examples run
composed 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
QCSXTZZZIBWUWF
RemoveItemAtPosition
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
QCSXTZZZIBWU
RemoveAt
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 extension
RemoveItemsAtPositions: remove items at multiple positions 2 examples run
o1 = new stzList([ "a", "b", "b", "b", "c" ])
o1.RemoveItemsAtPositions([2,3,4])
? o1.Content()
#--> a
#--> c
library testQCSXTZZZIBWU
RemoveItemsAtThesePositions
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
QCSXTZZZIBWU
RemoveSection: remove items between two positions 2 examples run
o1 = 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 testQCSXTZZZIBWU
RemoveSpaces
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
QCSXTZZZIBWU
RemoveDuplicatedItems
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
QCSXTZZZIBWU
IsReverseOf(paOther): TRUE iff @aContent is the reverse of paOther (deep-equal item-by-item). 1 examples run
o1 = new stzList([ 1, 2, 3, 6 ])
? o1.IsReverseOf([ 6, 3, 2, 1 ])
#--> 1
library testno extension
RemoveFirstItem / RemoveLastItem Remove the first item of the list (mutating). 1 examples run
composed 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
QCSXTZZZIBWU
RemoveLastItem
(no comment in the source: the name reads as a sentence) remove last itemin the section essential methods for submodule support
composed 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
QCSXTZZZIBWU
RemoveRange: remove items from start for a count 1 examples run
composed 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 extension
RemoveAllItems
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 testQCSXTZZZIBWUWFMany
Same as FindAllOccurrencesCS: FindAllOccurrencesCS: find all positions of an item 11 examples run
o1 = 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 testQCSXTZZZIBWUWFExcept
FindAllOccurrences
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 support
composed 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 extension
AddToEach
(no comment in the source: the name reads as a sentence) add to eachin the section essential methods for submodule support
composed 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 extension
FindInSections
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 support
composed 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 extension
CommonItems(:With = otherList): items present in both lists. 1 examples runalso written: Intersection
o1 = new stzList([ "a", "ab", "b" ])
? @@( o1.Intersection(:with = [ "a", "ab", "abc", "b", "bc", "c" ]) ) # Or CommonItems()
#--> [ "a", "ab", "b" ]
library testno extension
PreviousNItems: 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 extension
SpacesRemoved
SpacesRemoved (non-mutating): every string item stripped of spaces.also written: WithoutSapces · WithoutSpaces
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.SpacesRemoved() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page
no extension
SubStrongs
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 support
composed 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 support
composed 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 support
o1 = 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 support
composed 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 support
composed 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 extension
SAME 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 run
o1 = 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 support
composed 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 support
composed 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 support
composed 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 support
o1 = 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: FindStzObjects
o1 = 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 testQCSXTZZZIBWU
ToStzTable
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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 run
o1 = 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 testQCSXTZZZIBWU
NumberOfLeadingItems
(no comment in the source: the name reads as a sentence) number of leading itemsin the section essential methods for submodule support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 extension
NextNItemsAfter
(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 · NumberOfDuplicatesOf
o1 = new stzList(1:14 + 12)
# numberofoccurrence example 1
? @@( o1.NumberOfOccurrence(12) )
#--> 2
library testQCSXTZZZIBWUST
NumberOfOccurrences
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
QCSXTZZZIBWU
Same as NumberOfOccurrenceCS: NumberOfOccurrenceCS: count occurrences How many times the given item occurs in the list. 2 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Count(3)
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWUSTWF
NthOccurrenceCS
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 extension
Case-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 run
o1 = new stzList([ "_", "_", "♥", "_", "♥", "_", "_", "♥", "_", "_" ])
? o1.FindNth(3, "♥")
#--> 8
library testQCSXTZZZIBWU
Same as FindNthOccurrenceCS: FindNthOccurrenceCS: find nth occurrence 1 examples run
o1 = new stzList([ "_", "A", "_", "B", "C" ])
? o1.FindNthOccurrence(2, "_")
#--> 3
library testQCSXTZZZIBWU
FindNumbersAsSections: 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: NumbersAsSections
o1 = 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 extension
Same as FindFirstOccurrenceCS: FindFirstOccurrenceCS / FindLastOccurrenceCS The position of the FIRST occurrence of the item (0 if none). 11 examples run
o1 = new stzList([ "a", "ab", "abnA", "abAb" ])
? o1.Contains("n")
? o1.FindFirst("n")
#--> 0
#--> 0
library testQCSXTZZZIBWU
FindLastOccurrenceCS
(no comment in the source: the name reads as a sentence) find last occurrence csin the section essential methods for submodule support
composed 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 support
o1 = 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 testQCSXTZZZIBWU
Same as ContainsManyCS: ContainsManyCS: check if list contains multiple items 1 examples runalso written: ContainsEachOneOfThese
o1 = new stzList([ "1", "2", "A", "B", "C", "3", "4" ])
? o1.ContainsEach([ "A", "B", "C" ])
? o1.ContainsEachOneOfThese([ "A", "B", "C" ])
#--> 1
#--> 1
library testQCSXTZZZIBWU
ContainsAll
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
QCSXTZZZIBWU
Same as RemoveAllCS: RemoveAllCS: remove all occurrences of an item 4 examples run
oL = new stzList(aOrders)
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish", "rice", "soup", "rice" ]
library testQCSXTZZZIBWUExcept
FindW: find items matching a condition (eval-based) (case-sensitive by default) 3 examples runalso written: FindWhere · PositionsW · PositionsWhere · ItemsPositionsW · FindAllItemsWhere
o1 = 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
#--> 11
library testQCSXTZZZIBWUF
AllItemsWF
(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 run
o1 = new stzList([ "A", "B", "C" ])
? o1.CheckW('{ isString(@item) and IsUppercase(@item) }')
#--> 1
library testQCSXTZZZIBWUF
AllItemsVerify
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")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
EachItemVerifiesW
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")
#--> 0
composed from the signature, run for this page
no extension
the items at panPos all satisfy a W (DSL) condition 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.CheckItemsAtW([ 2, 3 ], "@item > 3")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWUF
Same as CheckItemsAtWF: WF variants: the items at panPos all satisfy an anonymous function 1 examples run
o1 = new stzList([ "Word1", "كلمة 2", "Word3", "كلمة 4", "Word5", "كلمة 6" ])
? o1.CheckOnWF([1, 3, 5], func x { return Q(x).IsLeftToRight() } )
#--> 1
library testno extension
CountUniqueItemsWF
(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: ItemsAt
aOrders = [ "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 testQCSXTZZZIBWU
ExtendToPositionWith
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 extension
Sugar aliases over ExtendToPositionXT: the same operation but using the more natural "ExtendTo" / "Extend" naming. Default filler is the empty string. 4 examples run
o1 = new stzList([ "A", "B", "C" ])
o1.ExtendTo(5)
? @@( o1.content() )
#--> [ "A", "B", "C", "", "" ]
library testQCSXTZZZIBWU
Same as ExtendToPositionXT: ExtendToPositionXT: extend list to a given position 1 examples run
o1 = 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 support
o1 = 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 run
o1 = new stzList([ "A", "B", "C", "D", "E" ])
o1.ShrinkTo(3)
? o1.Content()
#--> A
#--> B
#--> C
library testQCSXTZZZIBWU
TruncateTo
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 extension
KeepFirst
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 support
composed 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 support
o1 = new stzList("A" : "C")
o1.ExtendWith(["D", "E"])
# extendwith example 1
? @@( o1.Content() )
#--> [ "A", "B", "C", "D", "E" ]
library testno extension
Perform
Perform: execute code on each itemQCSXTZZZIBWUWF
PerformOn
PerformOn: execute code on specific positionsno extension
Min / Max for numeric lists 2 examples runalso named: smallest minimum lowest leastalso written: Lowest · Smallest
composed 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 support
composed 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 support
composed 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 support
composed 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 variance
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed 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 support
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.StddevPopulation()
#--> 2.37
composed from the signature, run for this page
no extension
Median
Median / Nth Smallest / Nth Largest (engine-backed)also named: middle value midpoint the median
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Median()
#--> 3
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 support
composed 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 support
composed 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
QCSXTZZZIBWU
Ranked
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 extension
Join
Join (engine-backed) The items joined into one string with the given separator.also named: concatenate glue together merge into one stringalso written: Joined
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.Join(" ")
#--> 5 3 8 3 1
composed from the signature, run for this page
no extension
IsListOfHashLists
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 extension
additional type checking methods 1 examples run
o1 = 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 extension
IsPairOfStrings
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 extension
Same as AntiFindCS: The positions of the items DIFFERENT from the given item. 1 examples run
o1 = 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 testQCSXTZZZIBWU
AntiFindAsSections
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
QCSXTZZZIBWU
getting the anti-positions of the given positions in the list 1 examples run
o1 = new stzList(1:10)
? o1.AntiPositions([ 3, 4, 7, 9 ])
#--> 1
#--> 2
#--> 5
#--> 6
#--> ...
library testQCSXTZZZIBWU
FindNOccurrences
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
QCSXTZZZIBWU
FindGivenOccurrences
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
QCSXTZZZIBWU
FindAllExceptLast
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
QCSXTZZZIBWU
The position of the nth occurrence of the item AFTER the given position (0 when there is none). 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextNthOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
FindNextOccurrence
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
QCSXTZZZIBWU
FindNext: convenience wrapper used by narrative tests. Accepts either FindNext(item, n) or FindNext(item, :StartingAt = n). 6 examples run
o1 = new stzList([ 1, 2, 3, "*", 5, 6, "*", 8, 9 ])
# findnext example 1
? @@( o1.FindNext("*", :StartingAt = 4) )
#--> 7
library testQCSXTZZZIBWUST
The position of the nearest occurrence of the item BEFORE the given position (0 when there is none). 4 examples run
o1 = new stzList([ "1", "2", "♥", "4", "♥", "6", "7" ])
? o1.FindPrevious("♥", :StartingAt = 5)
? o1.FindNthPrevious(2, "♥", :StartingAt = 6)
#--> 3
#--> 3
library testQCSXTZZZIBWUST
FindNthPrevious(n, pItem, pnStartingAt): word-order alias over FindPreviousNthOccurrence -- find the Nth occurrence of pItem walking backwards from pnStartingAt. Accepts :StartingAt = n. 5 examples run
o1 = new stzList([ 1, 2, 3, "A":"C", 5, 7, 8, 9, "A":"C" ])
? o1.FindNthPrevious(2, "A":"C", :StartingAt = 7)
#--> 0
library testQCSXTZZZIBWU
FindNthNext(n, pItem, pnStartingAt): symmetric forward variant. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNthNext(2, 3, 5)
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
The position of the nth occurrence of the item BEFORE the given position (0 when there is none). 1 examples run
o1 = new stzList([ "mio", "mix", "mia", "mio", "mix", "miz", "mix" ])
? o1.FindPreviousNthOccurrence( 2, :Of = "mix", :StartingAt = 6)
#--> 2
library testQCSXTZZZIBWU
FindPreviousOccurrence
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
QCSXTZZZIBWU
Missing name-variants for the next/previous occurrence family -- (delegating to stzListFinder; strictly-after / strictly-before). 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNthNextOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page
no extension
The position of the nth occurrence of the item after the given position. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindNextNth(2, 3, 5)
#--> 0
composed from the signature, run for this page
no extension
The positions of ALL the occurrences after the given position. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNextOccurrences(3, 2) )
#--> [ 4 ]
composed from the signature, run for this page
QCSXTZZZIBWUST
the listed nths (forward index) after / before a position 1 examples run
o1 = 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 extension
FindPreviousOccurrences
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 extension
FindFirstPrevious
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 extension
The positions of every occurrence of the item (the Find contract). 1 examples runalso named: index of position of locate where is at what index
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindItem(3) )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
The position of the nth occurrence before the given position. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.FindPreviousNth(2, 3, 5)
#--> 2
composed from the signature, run for this page
no extension
The position of the nth occurrence after the given position. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NthNextOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page
no extension
The position of the nth occurrence after the given position. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NextNthOccurrence(2, 3, 5)
#--> 0
composed from the signature, run for this page
no extension
smallest/largest positions, items-with-positions, etc. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindSmallest() )
#--> [ 5 ]
composed from the signature, run for this page
no extension
smallest/largest positions, items-with-positions, etc. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfSmallest()
#--> 1
composed from the signature, run for this page
no extension
smallest/largest positions, items-with-positions, etc. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfOccurrencesOfSmallestItem()
#--> 1
composed from the signature, run for this page
no extension
smallest/largest positions, items-with-positions, etc. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindLargest() )
#--> [ 3 ]
composed from the signature, run for this page
no extension
NumberOfLargest
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 extension
NumberOfOccurrencesOfLargestItem
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 · ItemsAndTheirPositions
o1 = 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 run
o1 = 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 extension
The positions of the items that repeat consecutively. 1 examples runQCSXTZZZIBWU
The items that repeat in consecutive runs (dup-secutive: duplicated AND consecutive). (case-sensitive by default) 1 examples runQCSXTZZZIBWU
The positions where the GIVEN item repeats consecutively. 1 examples runQCSXTZZZIBWU
The consecutive-duplicate run of the given item, along with its positions. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DupSecutiveItemCSZ(3, TRUE) )
#--> [ 3, [ ] ]
composed from the signature, run for this page
no extension
DupSecutiveItemZ
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 extension
RemoveDupSecutiveItems
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
QCSXTZZZIBWU
Same as RemoveDupSecutiveItemCS: Collapse the consecutive-duplicate runs of the GIVEN item (mutating). 1 examples run
composed 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
QCSXTZZZIBWU
The position(s) of the nth smallest item. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindNthSmallest(2) )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
FindNthLargest
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 extension
contiguous runs of strings / lists as [start,end] sections 1 examples runalso written: FindStringsZZ
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.FindStringsAsSections() )
#--> [ [ 1, 4 ] ]
composed from the signature, run for this page
no extension
The [start, end] runs of consecutive LIST items. 1 examples runalso written: FindListsZZno extension
FindObjectsAsSections
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 testQCSXTZZZIBWU
FindItemsOtherThan
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 extension
Same as RemoveAllCS: RemoveAllCS: remove all occurrences of an item 2 examples run
composed 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
QCSXTZZZIBWUWFMany
RemoveTheseItems
(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 extension
remove the panOcc-th occurrences of pItem (by occurrence index) 1 examples run
o1 = 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 run
composed 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 extension
Same as RemoveThisNthItem: remove the n-th occurrence of pItem 1 examples run
composed 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 extension
RemoveNextNthOccurrence
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 extension
RemoveNextNthOccurrences
(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 run
composed 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 extension
Same as RemoveFirst: remove the first occurrence of pItem 1 examples run
composed 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
QCSXTZZZIBWU
remove the item at position n; accepts :First / :Last 1 examples run
composed 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
#--> 1
library 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 run
composed 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
#--> 1
library 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 run
o1 = 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 extension
distinct items by occurrence count (>= n by default) 2 examples runalso written: ItemsOccuringNTimes · ItemsOccurringNTimesOrMore
composed 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 family
composed 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 family
composed 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 family
composed 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 family
oList = 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 family
oList = 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 family
o1 = 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
#--> 1
library testQCSXTZZZIBWU
ItemsHaveXT
all items satisfy a W-conditionalso written: AllItemsHaveXT
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ItemsHaveXT("@item > 3")
#--> 0
composed from the signature, run for this page
no extension
insert after/before many positions / by w-condition 1 examples run
o1 = new stzList([ "a", "b", "c", "d", "e" ])
o1.InsertAfterManyPositions([ 2, 4, 5 ], "*")
? @@( o1.Content() )
#--> [ "a", "b", "*", "c", "d", "*", "e", "*" ]
library testno extension
insert after/before many positions / by w-condition 1 examples run
o1 = new stzList([ "a", "b", "c", "d", "e" ])
o1.InsertBeforeManyPositions([ 2, 4, 5 ], "*")
? @@( o1.Content() )
#--> [ "a", "*", "b", "c", "*", "d", "*", "e" ]
library testno extension
NumberOfUniqueItemsW
How many unique items satisfy the given W condition.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.NumberOfUniqueItemsW("@item > 3")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWUF
SplitXT
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
QCSXTZZZIBWU
SplittedAtPositions
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
QCSXTZZZIBWU
SplitAtPosition
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
QCSXTZZZIBWU
SplittedAtPosition
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
QCSXTZZZIBWU
SplittedAt
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
QCSXTZZZIBWU
SplitBeforePosition
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 extension
SplittedBeforePosition
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 extension
SplitBefore
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
QCSXTZZZIBWU
SplitAfterPosition
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 extension
SplittedAfterPosition
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 extension
SplitAfter
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
QCSXTZZZIBWU
Split the list into n (near-)equal parts. 1 examples runalso named: divide chunk break into parts portions
o1 = new stzSplitter(3)
? @@( o1.SplitToNParts(0) )
o1 = new stzList([ "A", "B", "C" ])
? @@( o1.SplittedToNParts(3) )
#--> [ ]
#--> [ [ "A" ], [ "B" ], [ "C" ] ]
library testQCSXTZZZIBWU
The n (near-)equal parts of the list, as data. 3 examples run
o1 = 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 extension
SplitToPartsOfNItems
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
QCSXTZZZIBWU
SplitToPartsOf
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 extension
splitting to parts of n items 2 examples runalso written: SplittedToPartsOf
o1 = 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 testQCSXTZZZIBWU
SplitAtPacer
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 extension
SplittedAtPacer
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 extension
SplitW
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 extension
SplittedW
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 extension
HasRepeatedLeadingItems
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
QCSXTZZZIBWU
RepeatedLeadingItems
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
QCSXTZZZIBWU
HasRepeatedTrailingItems
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
QCSXTZZZIBWU
RepeatedTrailingItems
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
Empty the list, returning everything that was in it. 1 examples run
o1 = new stzList([ "A", "B", "C" ])
# extractall example 1
? @@( o1.ExtractAll() )
# extractall example 2
? @@( o1.Content() )
#--> [ "A", "B", "C" ]
#--> [ ]
library testno extension
ExtractNth
Remove the nth item and return it.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ExtractNth(2)
#--> 8
composed from the signature, run for this page
no extension
Remove the FIRST occurrence of the item and return it. 1 examples run
o1 = new stzList([ "_", "A", "B", "C" ])
? o1.ExtractFirst("_") + NL
? o1.Content()
#--> _
#--> A
#--> B
#--> C
library testQCSXTZZZIBWU
Remove the LAST occurrence of the item and return it. 1 examples run
o1 = new stzList([ "A", "B", "C", "_" ])
? o1.ExtractLast("_") + NL
? o1.Content()
#--> _
#--> A
#--> B
#--> C
library testQCSXTZZZIBWU
Remove the items at positions n1..n2 and return them. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ExtractSection(2, 5) )
#--> [ 3, 8, 3, 1 ]
composed from the signature, run for this page
no extension
Remove nRange items starting at nStart and return them. 1 examples runno extension
ExtractNthOccurrence
Same as ExtractNthOccurrenceCS: Remove the nth occurrence of the item and return it.
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ExtractNthOccurrence(2, 3)
#--> 3
composed from the signature, run for this page
QCSXTZZZIBWU
ExtractFirstOccurrence
Same as ExtractFirstOccurrenceCS: Remove the first occurrence of the item and return it.QCSXTZZZIBWU
ExtractLastOccurrence
Same as ExtractLastOccurrenceCS: Remove the last occurrence of the item and return it.QCSXTZZZIBWU
ExtractDuplicates
Same as ExtractDuplicatesCS: Remove the duplicated occurrences and return them.QCSXTZZZIBWU
ExtractStrings
Remove and return all the STRING items.no extension
ExtractNumbers
Remove and return all the NUMBER items.no extension
ExtractLists
Remove and return all the LIST items.no extension
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 extension
PopFirst
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 extension
Take
Remove the first n items and return them.also named: pop first items grab draw from the front
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.Take(2) )
#--> [ 5, 3 ]
composed from the signature, run for this page
no extension
TakeLast
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 extension
Same 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 run
o1 = new stzList([ 0, "", [], 1, 2, 3, [], NULL, 0 ])
o1.Trim()
? @@( o1.Content() )
#--> [ 1, 2, 3 ]
library testQCSXTZZZIBWU
Trimmed
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
QCSXTZZZIBWU
Same as TrimLeftCS: Remove the leading run of empty items (0, empty string, empty sublist, false-object) -- mutating. 1 examples run
o1 = new stzList([ 0, "", [], 1, 2, 3, [], NULL, 0 ])
o1.TrimLeft()
o1.TrimRight()
? @@( o1.Content() )
#--> [ 1, 2, 3 ]
library testQCSXTZZZIBWU
TrimmedLeft
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 extension
Same as TrimRightCS: Remove the trailing run of empty items (mutating). 1 examples run
o1 = new stzList([ 0, "", [], 1, 2, 3, [], NULL, 0 ])
o1.TrimLeft()
o1.TrimRight()
? @@( o1.Content() )
#--> [ 1, 2, 3 ]
library testQCSXTZZZIBWU
TrimmedRight
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 extension
TrimItem
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
QCSXTZZZIBWU
TrimItemFromLeft
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
QCSXTZZZIBWU
TrimItemFromRight
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
QCSXTZZZIBWU
Compact
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 extension
Compacted
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 extension
Squeeze
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 extension
StripNulls
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 extension
NullsStripped
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 extension
TrimToSize
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 extension
TrimmedToSize
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 extension
Same as UniqueItemsCS: The unique items of the list, in first-seen order. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.UniqueItems() )
#--> [ 5, 3, 8, 1 ]
composed from the signature, run for this page
QCSXTZZZIBWUWF
RandomItem
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 extension
EveryNthItem
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 extension
Tail
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 extension
OnlyStrings
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
QCSXTZZZIBWU
Only the NUMBER items of the list. 1 examples run
o1 = new stzList( 1:7 + "str1" + "str2" + [ "+", "-" ] )
# onlynumbers example 1
? @@( o1.OnlyNumbers() )
#--> [ 1, 2, 3, 4, 5, 6, 7 ]
library testQCSXTZZZIBWU
OnlyLists
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: ToPairs
composed 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 extension
Triplets
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 extension
SlidingWindow
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 extension
AddWalker
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 extension
WalkedLastPosition
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 extension
WalkedLastItem
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
QCSXTZZZIBWU
WalkNBackward
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
QCSXTZZZIBWU
WalkBetween
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
QCSXTZZZIBWU
WalkForthAndBack
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
QCSXTZZZIBWU
Walk forward up to and including the first occurrence of pItem. 1 examples run
o1 = new stzList([ "A", "B", "C", "D", "E", "F" ])
? @@( o1.WalkUntilItem("D") )
#--> [ 1, 2, 3, 4 ]
library testno extension
WalkW
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 extension
WalkUntil
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
QCSXTZZZIBWU
WalkWhile
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
QCSXTZZZIBWU
WalkZigZag
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 extension
WalkEveryNth
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 extension
WalkFromTo
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 extension
WalkSkipping
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 extension
WalkAccumulating
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 extension
WalkWhere
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 extension
WalkWhen
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
QCSXTZZZIBWU
Move / 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 run
composed 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
QCSXTZZZIBWUMany
Exchange the items at the two given positions (mutating). 2 examples runalso named: exchange swap positions interchange two items
composed 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 extension
MoveToStart
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 extension
MoveToEnd
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 extension
SwapFirstAndLast
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 extension
RotateLeft
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 extension
RotatedLeft
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 extension
RotateRight
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 extension
RotatedRight
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 extension
Shuffle
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 extension
MoveItemToEnd
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 extension
Sections
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
QCSXTZZZIBWU
AntiSection
finding the anti-section(s) of given section(s)QCSXTZZZIBWU
The [start, end] sections OUTSIDE the given sections. 2 examples run
o1 = 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 testQCSXTZZZIBWU
The items lying outside the given sections. 1 examples run
o1 = 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 testQCSXTZZZIBWU
Ranges
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 extension
Classified
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 extension
Classes
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 extension
ClassesSF
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 extension
NumberOfClasses
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 extension
Frequencies
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 extension
MostFrequent
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 extension
LeastFrequent
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 extension
GroupBy
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 extension
Histogram
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 extension
ItemsAppearingNTimes
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 extension
ItemsAppearingMoreThanNTimes
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 extension
FrequencyOf
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 extension
Mode
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 extension
Bisect
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 extension
FirstHalf
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
QCSXTZZZIBWU
SecondHalf
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
QCSXTZZZIBWU
PartitionW
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 extension
Chunks
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 extension
RandomPosition
getting a random position in the listalso written: APosition · AnyPosition · ARandomPosition
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.AnyPosition()
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWUExcept
RandomSection
A random [start, end] pair within the list's positions.also written: ASection · AnySection · ARandomSection
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ASection() )
#--> [ 4, 4 ]
composed from the signature, run for this page
no extension
RandomPositionGreaterThan
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 extension
RandomiseNumbers
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 extension
RandomiseStrings
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 extension
SectionRandomized
randomizing the items positions in the given section of the listno extension
PerformAtW
PerformAtW: transform only the items that are BOTH at one of panPos -- and satisfy the W condition (the position-restricted PerformW).no 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 extension
PerformOnEachItemAndItsPosition
perform on each with indexno extension
YieldPairs
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 extension
AssociatedWith
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 extension
InterleaveWith
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 extension
ZipWith
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 extension
ZippedWith
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 extension
Unzip
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 extension
PrependedWith
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 extension
DiffWith
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 extension
IntersectWith
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 extension
UnionWith
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 extension
Insert
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 extension
InsertAfterPosition
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 extension
InsertBeforePositions
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 extension
AreBoundsOf
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 run
o1 = new stzList([ "{", "A", "B", "C", "}" ])
? o1.IsBoundedBy([ "{", "}" ]) + NL
o1.RemoveTheseBounds("{", "}")
? o1.Content()
#--> 1
#--> A
#--> B
#--> C
library testQCSXTZZZIBWU
getting bounds of the list up to n items 1 examples run
o1 = new stzList([ "{", "<", "A", "B", "C", ">", "}" ])
? @@( o1.BoundsUpToNItems(1) ) + NL
? @@( o1.BoundsUpToNItems(2) )
#--> [ "{", "}" ]
#--> [ [ "{", "<" ], [ ">", "}" ] ]
library testno extension
Bounds
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
QCSXTZZZIBWU
RemoveBounds
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 extension
ClampedTo
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 extension
ClampTo
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 extension
ItemsBetweenPositions
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 extension
On 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 · EachItemIsEitherAn
o1 = new stzList([ 6, -2, 9, 5, -10 ])
? o1.EachItemIsEitherA(:Positive, :Or = :Negative, :Number)
#--> 1
library testno extension
Same 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: DeeplyContains
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.DeepContains(3)
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWUMany
Deep find: the index-path to every (nested) occurrence of pItem. Engine-backed via the stzDeepList wrapper (stz_list_deep_find). 2 examples runalso written: DeepFindAll
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.DeepFind(3) )
#--> [ [ 2 ], [ 4 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
Paths
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 run
o1 = 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 extension
ListsAtAnyLevel
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 runQCSXTZZZIBWU
DeeplyReplace
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 runQCSXTZZZIBWUMany
DeepRemoved
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 extension
ManyDeepRemoved
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 extension
Unicodes
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 extension
Names
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 extension
SortOnDown
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
QCSXTZZZIBWU
SortedOnDown
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 extension
IsMadeOfNumbersOrStrings
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: IsMadeOfNumbersAndStrings
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.IsMadeOfNumbersOrStrings()
#--> 1
composed from the signature, run for this page
no extension
IsMadeOfNumbers
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 extension
IsMadeOfStrings
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 extension
Types(): 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 testQCSXTZZZIBWU
Unique 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 testQCSXTZZZIBWU
ItemsAndTheirTypes: each item paired with its type name, in order. -- e.g. [ 1, "A", [2] ] -> [ [1,"NUMBER"], ["A","STRING"], [[2],"LIST"] ]. 1 examples run
composed 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
QCSXTZZZIBWU
TypesAndTheirSections (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 run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.TypesAndTheirSections() )
#--> [ [ "NUMBER", [ [ 1, 5 ] ] ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
The items that are NOT numbers (engine DSL) 1 examples runalso written: OnlyNonNumbers
o1 = new stzList([ "A", "B", 1, "C", 2, 3, "D", 4, 5 ])
? o1 - These( o1.NonNumbers() )
#--> 1
#--> 2
#--> 3
#--> 4
#--> ...
library testQCSXTZZZIBWU
A copy of the list with every numeric 0 removed (non-mutating) 1 examples run
o1 = new stzList([ "A", 0, 0, "B", "C", 0, "D", 0, 0 ])
? o1.ZerosRemoved()
#--> A
#--> B
#--> C
#--> D
library testQCSXTZZZIBWU
The 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 run
o1 = new stzList([ "S", "O", "F", "T", "A", "N", "Z", "A" ])
? o1.NthToLast(2)
#--> N
library testno extension
Shrink the list down to its first n items (mutating). -- Accepts Shrink(n) or the named form Shrink(:ToPosition = n). 1 examples run
o1 = 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 testQCSXTZZZIBWU
Swap two items by position (mutating). Accepts SwapItems(n1, n2) -- or the named form SwapItems(:AtPositions = n1, :And = n2). 1 examples runQCSXTZZZIBWU
A two-item list whose both items share a given type. 1 examples runalso written: Contains2Numbers · ContainsTwoNumbers
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreNumbers()
#--> 0
composed from the signature, run for this page
no extension
BothAreStrings
For a PAIR: TRUE if both items are strings.also written: Contains2Strings · ContainsTwoStrings
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreStrings()
#--> 0
composed from the signature, run for this page
no extension
BothAreLists
For a PAIR: TRUE if both items are lists.also written: Contains2Lists · ContainsTwoLists
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreLists()
#--> 0
composed from the signature, run for this page
no extension
BothAreObjects
For a PAIR: TRUE if both items are objects.also written: Contains2Objects · ContainsTwoObjects
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.BothAreObjects()
#--> 0
composed from the signature, run for this page
no extension
IsMadeOf family: "the list consists of these items". -- IsMadeOf / IsMadeOfThese -> contains ALL the given items. 1 examples run
o1 = 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 extension
Same as ContainsMany: Same as ContainsManyCS: ContainsManyCS: check if list contains multiple items 1 examples run
o1 = new stzList([ "by", "except", "stopwords" ])
? o1.IsMadeOfThese([ :by, :except, :stopwords ])
#--> 1
library testno extension
TRUE if every item is of the given type. 2 examples runalso written: ContainsOnly
o1 = 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
#--> 1
library testQCSXTZZZIBWU
ContainsSome
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
QCSXTZZZIBWU
IsMadeOfSomeOfThese
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 extension
IsMadeOfOneOrMoreOfThese
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 extension
IsMadeOfOneOrMoreOf
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 extension
IsMadeOfUniformLists -> all items are lists with the same size. 1 examples runalso written: IsMadeOfUniSizeLists · IsMadeOfUniformLists · ContainsOnlyUniSizeLists
o1 = new stzList([
	[ "A", "B", "C" ],
	[ 1, 2, 3 ],
	[ NULL, NULL, [] ]
])
? o1.IsMadeOfUniformLists() # Or more precisely: IsMadeOfUnisizeLists()
#--> 1
library testno extension
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.) 1 examples runno extension
NBoundsOf
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
Same as ExtractCS: Remove the occurrences of the given item and RETURN them (extract = remove + return). 3 examples run
o1 = new stzList([ "A", "B", "_", "C" ])
# extract example 1
? @@( o1.Extract("_") )
# extract example 2
? @@( o1.Content() )
#--> "_"
#--> [ "A", "B", "C" ]
library testQCSXTZZZIBWUWFMany
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
QCSXTZZZIBWU
RemoveItemCS
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 extension
ContainsAtLeastOneW
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")
#--> 1
composed from the signature, run for this page
no extension
Same 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: SectionsBetweenItemsQCSXTZZZIBWU
Distribute the items over the given beneficiaries, round-robin. 1 examples runQCSXTZZZIBWU
A copy with all occurrences of an item removed (non-mutating). 1 examples runalso written: AllOccurrencesOfThisItemRemoved
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.ItemRemoved(3) )
#--> [ 5, 8, 1 ]
composed from the signature, run for this page
QCSXTZZZIBWU
True if EVERY given position holds an item matching a W condition. 1 examples runalso written: ContainsAtW
composed 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 extension
Same as EachContainsCS: EachContains: every item (string or sub-list) contains pItem. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.EachContains(3)
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
EachItemContains
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
QCSXTZZZIBWU
Same 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 testQCSXTZZZIBWU
The items shared with the given list. 1 examples runalso written: Common
o1 = 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 extension
IntersectionWith
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 extension
DifferentItemsWith
Same as DifferentItemsWithCS: Symmetric difference: (this items not in other) ++ (other items not -- in this). Engine-faithful element compare via BothAreEqualCS.also written: Diff
composed 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
QCSXTZZZIBWUXTT
Same as ContainsSameItemsAsCS: Same items as another list, regardless of order/count (set equality). 1 examples run
o1 = 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
IsContainedIn
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 testQCSXTZZZIBWU
Same as EachItemExistsInCS: AreContainedIn / ExistIn: every item of this list also exists -- somewhere in the other list (element-wise membership). 1 examples run
o1 = new stzList([ "A", "B", "C" ])
? o1.EachItemExistsIn([ "1", "2", "A", "B", "C", "3", "4" ])
#--> 1
library testQCSXTZZZIBWU
Same 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 extension
AreContainedIn
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 extension
Same as HasSameNumberOfItemsAsCS: HasSameNumberOfItemsAs: same length as another list. 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.HasSameNumberOfItemsAs([ 2, 3 ])
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
HasSameSizeAs
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 extension
HasSameWidthAs
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 extension
ContainsNoOneOfThese
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 extension
ContainsNoneOfThese
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 extension
ContainsNoItemOfThese
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 extension
Objects
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: StringsAndNumbers
o1 = 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 testQCSXTZZZIBWU
Lowercased
A copy with every string item lower/upper-cased (UTF-8 via the -- engine-backed StzLower/StzUpper); non-string items pass through.also written: StringsLowercased
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Lowercased() )
#--> [ "tea", "rice", "tea", "fish" ]
composed from the signature, run for this page
no extension
Uppercased
A copy with every string item uppercased; the original is unchanged.also written: StringsUppercased
composed example
o1 = new stzList([ "tea", "rice", "tea", "fish" ])
? @@( o1.Uppercased() )
#--> [ "TEA", "RICE", "TEA", "FISH" ]
composed from the signature, run for this page
no extension
VizFindAllOccurrences
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 runQCSXTZZZIBWUMany
VizFindAll
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 runQCSXTZZZIBWU
VizDeepFindAll
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 extension
Strings
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
QCSXTZZZIBWUWF
NumberOfStrings
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 extension
Chars
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 extension
Lists
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 extension
NumberOfPairs
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 extension
Extend 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 run
o1 = 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 testQCSXTZZZIBWU
ExtendToPositionWithItemsIn
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 extension
Same as ExtendToPositionWithItemsIn: Extend the list to position n by cycling the given items (mutating). 1 examples run
o1 = new stzList(1 : 3)
o1.ExtendToWithItemsIn( 8, "A":"C" )
# extendtowithitemsin example 1
? @@( o1.Content() )
#--> [ 1, 2, 3, "A", "B", "C", "A", "B" ]
library testno extension
ExtendToPositionWithItemsRepeated
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 extension
ExtendToWithItemsRepeated
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 extension
ExtendToByRepeatingItems
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 extension
Size 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 extension
TRUE 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 extension
IsListOfEmptyLists: every item is an empty list. 1 examples runalso written: AllItemsAreEmptyLists · ContainsOnlyEmptyLists
? Q([ [], [] ]).AllItemsAreEmptyLists()
? @@( Association([ [], [] ]) )
#--> 1
#--> [ ]
library testno extension
FindFirstDuplicates
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 · FindDuplicationsOrigins
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindFirstDuplicates() )
#--> [ 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindFirstDuplicatedItems
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 extension
FindFirstOccurrenceOfEachDuplicatedItem
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 extension
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). 1 examples run
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? @@( o1.FindDupOrigins() )
#--> [ 2 ]
composed from the signature, run for this page
no extension
Remove the first occurrence of each duplicated item (mutating). 1 examples run
composed 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 extension
RemoveDuplicatesOrigins
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 extension
operator
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
#--> 1
library testQCSXTZZZIBWU
ContainsNonDuplicatedItems
Same as ContainsNonDuplicatedItemsCS: NON-DUPLICATED ITEMS TRUE if at least one item occurs exactly once.also written: ContainsItemsNonDuplicated · ContainsAtLeastOneNonDuplicatedItem
composed example
o1 = new stzList([ 5, 3, 8, 3, 1 ])
? o1.ContainsNonDuplicatedItems()
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsItemsThatAreNotDuplicatedCS
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 extension
NonDuplicatedItems
(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
(no comment in the source: the name reads as a sentence) extract at 1 examples runin the section removed" -- the destructive counterpart of find.
o1 = new stzList([ "A", "_", "B", "C" ])
? o1.ExtractAt(2) + NL
? o1.Content()
#--> _
#--> A
#--> B
#--> C
library testno extension
(no comment in the source: the name reads as a sentence) extract next 1 examples runin the section removed" -- the destructive counterpart of find.
o1 = new stzList([ 1, 2, "♥", 4, "♥", 6, "♥" ])
? o1.ExtractNext("♥", :StartingAt = 4)
? @@( o1.Content() )
#--> ♥
#--> [ 1, 2, "♥", 4, 6, "♥" ]
library testQCSXTZZZIBWUST
(no comment in the source: the name reads as a sentence) extract previous 1 examples runin the section removed" -- the destructive counterpart of find.
o1 = new stzList([ 1, 2, "♥", 4, "♥", 6, "♥" ])
# ExtractPrevious('♥', :StartingAt = 6) returns the position-5 marker
? o1.ExtractPrevious("♥", :StartingAt = 6)
# ...and the extracted marker is removed from the list
? @@( o1.Content() )
#--> ♥
#--> [ 1, 2, "♥", 4, 6, "♥" ]
library testQCSXTZZZIBWUST
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
QCSXTZZZIBWU
HasSameContent: 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 testQCSXTZZZIBWU
First sublist (item that is itself a list) and its position. 1 examples run
o1 = new stzList([ "A", "B", 1:3, "C", "D", 4:5 ])
? o1.FirstList()
? o1.FindFirstList()
#--> 1
#--> 2
#--> 3
#--> 3
library testno extension
allitemsareequalto (split-dropped / new). 1 examples run
o1 = new stzList([ "A", "B", 1:3, "C", "D", 4:5 ])
? o1.FirstList()
? o1.FindFirstList()
#--> 1
#--> 2
#--> 3
#--> 3
library testno extension
Same as AllItemsAreEqualToCS: AllItemsAreEqualTo: every item equals pItem (content-compare, so -- sublists match too). 1 examples run
o1 = new stzList([ 1, 1, 1 ])
? o1.AllItemsAreEqualTo(1)
#--> 1
library testQCSXTZZZIBWU
FindNumbers
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
QCSXTZZZIBWU
FindNonNumbers
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 extension
RemoveNumbers
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 extension
RemoveOnlyNumbers
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 extension
RemoveAllExceptNonNumbers
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 extension
RemoveNonNumbers
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: NumberOfOccurrenceOfEachItem
composed 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
QCSXTZZZIBWU
TRUE if every item is a number or a pair of numbers. 1 examples run
o1 = new stzList([ 0, 2, 0, 3, [1,2] ])
? o1.IsListOfNumbersAndPairsOfNumbers()
#--> 1
library testno extension
SplitAfterPositions
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
QCSXTZZZIBWU
The parts split after the given positions, as data. 1 examples run
o1 = 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 extension
SplitBeforePositions
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
QCSXTZZZIBWU
The parts split before the given positions, as data. 1 examples run
o1 = 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 extension
Same as FindNthPreviousOccurrenceCS: Nth previous occurrence (scanning backward from a start position). 1 examples runalso written: PreviousNthOccurrence
o1 = 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 testQCSXTZZZIBWU
Same as RemoveTheseBoundsCS: Remove a matching opening/closing bound pair (e.g. "{" ... "}"). -- TheseBoundsRemoved returns a fresh list; RemoveTheseBounds mutates. 1 examples run
o1 = new stzList([ "{", "A", "B", "C", "}" ])
? o1.IsBoundedBy([ "{", "}" ]) + NL
o1.RemoveTheseBounds("{", "}")
? o1.Content()
#--> 1
#--> A
#--> B
#--> C
library testQCSXTZZZIBWU
A copy with the two given bounds removed from the ends. 2 examples run
o1 = new stzList([ "{", "A", "B", "C", "}" ])
? o1.TheseBoundsRemoved("{", "}")
#--> A
#--> B
#--> C
library testno extension
Multiply the list by the given factor (number: tile; list: pairwise). 1 examples runno extension
The positions of the stzNumber OBJECT items. 1 examples run
o1 = 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 extension
Same as ReplaceThisItemAt: positional replacers (ported from the monolith) 1 examples run
o1 = new stzList([ "♥", 2, "♥", "♥", 5 ])
o1.ReplaceAt([2, 5], "♥")	# Or ReplaceAnyAt()
? @@( o1.Content() )
o1.ReplaceThisAt(3, "♥", 3)
? @@( o1.Content() )
#--> [ "♥", "♥", "♥", "♥", "♥" ]
#--> [ "♥", "♥", 3, "♥", "♥" ]
library testno extension
ReplaceAnyAt
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 run
o1 = 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 extension
The positions of the stzList OBJECT items. 1 examples run
o1 = 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 extension
ToStzListOfStrings
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 run
o1 = new stzList([ "A1", "A2", "A3" ])
o1.InsertAfter( :ItemAtPosition = 3, "A4" )
? o1.Content()
#--> A1
#--> A2
#--> A3
library testQCSXTZZZIBWUWF
UppercaseQ
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 run
o1 = 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 extension
DeepContainsThese
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 extension
tion over the established per-string locale lookups. 1 examples run
? Q([ :ar, :en, :fr ]).AreLanguageAbbreviations()
#--> 1
library testno extension
tion over the established per-string locale lookups. 1 examples run
o1 = 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
#--> 1
library testno extension
tion over the established per-string locale lookups. 1 examples run
o1 = new stzList([ :english = "house", :french = "maison", :arabic = "منزل" ])
? o1.IsMultilingualString()
o1 = new stzList([ :en = "house", :fr = "maison", :ar = "منزل" ])
? o1.IsMultilingualString()
#--> 1
#--> 1
library testno extension
ReplaceRepeatedLeadingItem
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 extension
WalkBackAndForth
(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 backwardalso 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
QCSXTZZZIBWU
WalkNItemsFromStartNItemsFromEnd
walking n steps from start and n steps from endalso 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
QCSXTZZZIBWU
WalkNItemsFromEndNItemsFromStart
walking n steps from start and n steps from endalso 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