Debian Codegraph @

texmf-dist/doc/latex/starray/starray.tex

raw
1 %%%==============================================================================
2 % WinEdt pragmas
3 % !Mode:: "TeX:EN"
4 % Default Compile engines:
5 % !TEX program = pdflatex
6 % !PDFTeXify ext = --enable-etex --restrict-write18
7 % !PDFLaTeX ext = --enable-etex --restrict-write18
8 % !BIB program = biber
9 %%%==============================================================================
10 %% Copyright 2023-present by Alceu Frigeri
11 %%
12 %% This work may be distributed and/or modified under the conditions of
13 %%
14 %% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
15 %% version 1.3c (or later), and/or
16 %% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html),
17 %% version 3 (or later)
18 %%
19 %% This work has the LPPL maintenance status *maintained*.
20 %%
21 %% The Current Maintainer of this work is Alceu Frigeri
22 %%
23 %% This is version {2.1} {2026/02/24}
24 %%
25 %% The list of files that compose this work can be found in the README.md file at
26 %% https://ctan.org/pkg/starray
27 %%
28 %%%==============================================================================
29 \documentclass[10pt]{article}
30 \RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={40mm,20mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry}
31 %\RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={45mm,25mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry}
32 \usepackage[T1]{fontenc}
33 \usepackage[utf8]{inputenc}
34 \usepackage{lmodern}
35 \usepackage[infograb,silence]{codedescribe}
36 \usepackage{starray}
37 \RequirePackage[inline]{enumitem}
38 \SetEnumitemKey{miditemsep}{parsep=0ex,itemsep=0.4ex}
39
40 %% if needed
41 \RequirePackage[backend=biber]{biblatex}
42 \addbibresource{starray.bib}
43
44 % Just so the kernel reference date [...] can be written as
45 % \Bhack[2026/06/01]
46 % (and the date itself be globally updated)
47 %
48 \def\Bhack[#1]{#1}
49
50 \newcodekey{starray}{
51 codeprefix={},resultprefix={},letter={@,_},
52 texcs=[2]{starray_new,starray_if_exist,starray_if_valid,starray_def_prop,starray_def_struct,starray_def_from_keyval,starray_fix_terms,starray_new_term},
53 texcs=[2]{starray_set_iter,starray_reset_iter,starray_next_iter,starray_set_iter_from_hash},
54 texcs=[2]{starray_iterate_over},
55 texcs=[2]{starray_set_prop,starray_gset_prop,starray_set_from_keyval,starray_gset_from_keyval},
56 texcs=[2]{starray_get_prop,starray_if_in,starray_get_unique_id,starray_get_iter,starray_get_cnt},
57 texcs=[2]{starray_term_parser},
58 texcs=[2]{starray_parsed_get_prop,starray_parsed_if_in,starray_parsed_get_unique_id,starray_parsed_get_iter,starray_parsed_get_cnt},
59 texcs=[2]{starray_uparsed_get_prop,starray_uparsed_if_in,starray_uparsed_get_unique_id,starray_uparsed_get_iter,starray_uparsed_get_cnt},
60 texcs=[2]{starray_iparsed_get_prop,starray_iparsed_if_in,starray_iparsed_get_unique_id,starray_iparsed_get_iter,starray_iparsed_get_cnt},
61 % keywd=[2]{oarg,arg,parg,xarg,meta,color},
62 % keywd={codedescribe,codesyntax,codestore,tsremark},
63 emph=[2]{struct}
64 }
65
66
67 \RequirePackage[hidelinks,hypertexnames=false]{hyperref}
68 \begin{document}
69 \tstitle{
70 author={Alceu Frigeri\footnote{\tsfmt{\url{https://github.com/alceu-frigeri/starray}}}},
71 date={\tsdate},
72 title={The starray Package\break Version \PkgInfo{starray}{version}}
73 }
74
75 \begin{typesetabstract}
76
77 This package implements vector like 'structures', alike 'C' and other programming languages.
78 It's based on \tsobj[pkg]{expl3}\cite{expl3} and aimed at 'package writers', and not end users. The provided commands are similar the ones provided for property (or sequence, or token) lists. Most of the provided functions have a companion ``branching version''.
79
80 \end{typesetabstract}
81
82 \tableofcontents
83
84 \section{Introduction}
85 The main idea is to have an array like syntax when setting/recovering structured information, e.g. \tsmacro{\starray_get_prop:nn} {student[2].work[3].reviewer[4] , name} where ``student'' is the starray root, ``work'' is a sub-structure (an array in itself), ``reviewer'' is a sub-structure of ``work'' and so on, \tsobj[marg]{name} being a property of ``reviewer''. Moreover one can iterate over the structure, for instance \tsmacro{\starray_get_prop:nn}{student.work.reviewer,name} is also a possible reference in which one is using ``student's'', ``work's'' and ``reviewer's'' iterators.
86
87 Internally, a \tsobj[pkg]{starray} is stored as a collection of property lists. Each \tsobj[pkg]{starray} can contain a list of property pairs (key/value as in any \tsobj[pkg]{expl3}\cite{expl3} property lists) and a list of sub-structures. Each sub-structure, at it's turn, can also contain a list of property pairs and a list of sub-structures.
88
89 The construction/definition of a \tsobj[pkg]{starray} can be done piecewise (a property/sub-structure a time) or with a keyval interface or both, either way, one has to first ``create a root starray'' (\tsmacro{\starray_new:n}{}), define it's elements (properties and sub-structures), then instantiate them ``as needed''. An instance of a \tsobj[pkg]{starray} (or one of it's sub-structures) is referred, in this text, as a ``term''.
90
91 Finally, almost all defined functions have a branching version, as per \tsobj[pkg]{expl3}\cite{expl3}: \tsobj[code]{T,F,TF} (note: no \tsobj{_p} variants, see below). For simplicity, in the text bellow only the \underline{\textsl{TF}} variant is described, as in \tsobj[code]{\starray_new:nTF}, keep in mind that all 3 variants are defined, e.g. \tsobj[code]{\starray_new:nT,\starray_new:nF,\starray_new:nTF}.
92
93 \begin{tsremark}[Note:]
94 Could it be implemented with a single property list? It sure could, but at a cost:
95 \begin{enumerate*} \item complexity; \item access time. \end{enumerate*}
96 The current implementation, albeit also complex, tries to reach a balance between an inherent structure complexity, number of used/defined auxiliary property lists and access time.
97 \end{tsremark}
98
99 \begin{tsremark}[\color{red}Important:]
100 \textsl{Expandability}, unfortunately most/all defined functions are not expandable, in particular, most conditional/branching functions aren't, with just a few exceptions (marked with a star \ding{72}).
101
102 \end{tsremark}
103
104 \subsection{Prerequisites}
105 Besides a fairly recent kernel (as recent as \Bhack[2025/06/01], see \cite{l3kernel}), the packages \tsobj[pkg]{pkginfograb}\cite{pkginfograb} (for package documentation) and \tsobj[pkg]{tokglobalstack}\cite{tokglobalstack} (stack implementation for the iterate over commands see \ref{iterate-over}) are also used.
106
107 \section{Package Options}\label{pack:options}
108 The package options (\tsobj[key]{key}\,=\tsobj[value]{value}) are:
109 \begin{describelist}{option}
110 %\describe{prefix}{(default: \tsobj[value]{\detokenize{l__starray_}} ). Set the \tsobj[key]{prefix} used when declaring the property lists associated with any \tsobj[pkg]{starray}.}
111
112 \describe{msg-err}
113 {By default, the \tsobj[pkg]{starray} package only generates ``warnings'', with \tsobj[option]{msg-err} one can choose which cases will generate ``package error'' messages. There are 3 message classes:
114 \begin{enumerate}[nosep]
115 \item \tsobj[value]{strict} relates to \tsmacro{\starray_new:n}{} cases (\tsobj[pkg]{starray} creation);
116 \item \tsobj[value]{syntax} relates to ``term syntax'' errors (student.work.reviewer in the above examples); and
117 \item \tsobj[value]{reference} relates to cases whereas the syntax is correct but referring to a non-existent term or property.
118 \end{enumerate}
119 }
120
121 \begin{describelist*}{value}
122 \describe{none}{ (default) no package message will raise an error.}
123 \describe{strict}{ will raise an error on \tsobj[value]{strict} case alone.}
124 \describe{syntax}{ will raise an error on \tsobj[value]{strict} and \tsobj[value]{syntax} cases.}
125 \describe{reference}{ will raise an error on \tsobj[value]{strict}, \tsobj[value]{syntax} and \tsobj[value]{reference} cases.}
126 \describe{all}{ will raise an error on all cases.}
127 \end{describelist*}
128
129 \describe{msg-suppress}{ditto, to suppress classes of messages:}
130 \begin{describelist*}{value}
131 \describe{none}{ (default) no package message will be suppressed.}
132 \describe{reference}{ only \tsobj[value]{reference} level messages will be suppressed.}
133 \describe{syntax}{ \tsobj[value]{reference} and \tsobj[value]{syntax} level messages will be suppressed.}
134 \describe{strict}{ \tsobj[value]{reference}, \tsobj[value]{syntax} and \tsobj[value]{strict} level messages will be suppressed.}
135 \describe{all}{ all messages will be suppressed.}
136 \end{describelist*}
137
138 \describe{parsed check}{By default (false) the many \tsobj{\starray_parsed_} commands won't check if the last \tsobj{\starray_term_parser:} was successful. With this option, they will test it (with a performance hit) raising a warning/error accordantly.}
139 \describe{NN names}{Compatibility option. See \ref{parsed:user-var} for more details. Possible values are:}
140 \begin{describelist*}{value}
141 \describe{none}{(default) None of the old \tsobj{...parsed..:NN..} functions will be defined.}
142 \describe{no warnings}{The old \tsobj{...parsed..:NN..} functions will be defined. No warnings will be issued}
143 \describe{strict}{The old \tsobj{...parsed..:NN..} functions will be defined, issuing a deprecation warning at each use.}
144 \end{describelist*}
145 \describe{iter cascade}{By default, since version 2.0, when setting the value of an iterator, none of the substructure's iterators will be affected. With this option set, all substructure's iterators will be reset to 1 (or zero), see \ref{pack:iter}.}
146 \end{describelist}
147
148 \section{Demo package(s)}
149 Given the inherent complexity of this package, one can find at \tsfmt{\url{https://github.com/alceu-frigeri/starray/tree/main/demo}} an example, \tsobj[pkg]{stdemo.sty}, package and documentation \tsobj[pkg]{stdemo.pdf}. Since the aforementioned package, and documentation, are just an example of use, it doesn't make sense to add them to CTAN.
150
151 \section{Creating a starray}\label{pack:new}
152 \begin{codedescribe}{\starray_new:n,\starray_new:nTF}
153 \begin{codesyntax}%
154 \tsmacro{\starray_new:n}{starray}
155 \tsmacro{\starray_new:nTF}{starray,if-true,if-false}
156 \end{codesyntax}
157 Creates a new \tsobj[marg]{starray} or raises a warning if the name is already taken. The declaration (and associated property lists) is global. The given name is referred (in this text) as the \tsobj[marg]{starray-root} or just \tsobj[marg]{root}.
158 \end{codedescribe}
159 \begin{tsremark}
160 A warning is raised (see \ref{pack:options}) if the name is already taken. The branching version doesn't raise any warning.
161 \end{tsremark}
162
163 \subsection{Conditionals}\label{conditionals:exist}
164 \begin{codedescribe}[code,EXP,new=2023/05/20,update=2024/03/28]{\starray_if_exist_p:n,\starray_if_exist:nTF,\starray_if_valid_p:n,\starray_if_valid:nTF}
165 \begin{codesyntax}%
166 \tsmacro{\starray_if_exist_p:n}{starray}
167 \tsmacro{\starray_if_exist:nTF}{starray,if-true,if-false}
168 \tsmacro{\starray_if_valid_p:n}{starray}
169 \tsmacro{\starray_if_valid:nTF}{starray,if-true,if-false}
170 \end{codesyntax}
171 \tsobj{\starray_if_exist:nTF} only tests if \tsobj[marg]{starray} (the base array) is defined. It doesn't verifies if it really is a \tsobj[pkg]{starray}. \tsobj{\starray_if_valid:nTF} is functionally equivalent, since release 1.9. See \tsobj{\starray_term_parser:nTF}, section \ref{conditionals:terms}, for a more reliable validity test.
172 \end{codedescribe}
173 \begin{tsremark}
174 The predicate versions, \tsobj{_p}, expand to either \tsobj{\c_true_bool} or\break \tsobj{\c_false_bool}
175 \end{tsremark}
176
177 \section{Defining and initialising a starray structure}\label{pack:def}
178
179 \begin{codedescribe}{\starray_def_prop:nnn,\starray_def_prop:nnnTF}
180 \begin{codesyntax}%
181 \tsmacro{\starray_def_prop:nnn}{starray-ref,prop-key,initial-value}
182 \tsmacro{\starray_def_prop:nnnTF}{starray-ref,prop-key,initial-value,if-true,if-false}
183 \end{codesyntax}
184 Adds an entry, \tsobj[marg]{prop-key}, to the \tsobj[marg]{starray-ref} (see \ref{pack:ref}) definition and set its initial value. If \tsobj[marg]{prop-key} is already present its initial value is updated. Both \tsobj[marg]{prop-key} and \tsobj[marg]{initial-value} may contain any \tsobj[marg]{balanced text}. \tsobj[marg]{prop-key} is an (\tsobj[pkg]{expl3}\cite{expl3}) property list \tsobj[marg]{key} meaning that category codes are ignored.
185
186 The definition/assignment of a \tsobj[marg]{prop-key} to a \tsobj[marg]{starray-ref} is global.
187 \end{codedescribe}
188
189 \begin{tsremark}
190 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax/reference error. The branching version doesn't raise any warning.
191 \end{tsremark}
192
193 \begin{codedescribe}{\starray_def_structure:nn,\starray_def_structure:nnTF}
194 \begin{codesyntax}%
195 \tsmacro{\starray_def_struct:nn}{starray-ref,struct-name}
196 \tsmacro{\starray_def_struct:nnTF}{starray-ref,struct-name,if-true,if-false}
197 \end{codesyntax}
198 Adds a sub-structure (a \tsobj[pkg]{starray} in itself) to \tsobj[marg]{starray-ref} (see \ref{pack:ref}). If \tsobj[marg]{struct-name} is already present nothing happens. The definition/assignment of a \tsobj[marg]{struct-name} to a \tsobj[marg]{starray-ref} is global.
199 \end{codedescribe}
200
201
202 \begin{tsremark}
203 Do not use a dot when defining a (sub-)structure name, it might seems to work but it will breaks further down (see \ref{pack:ref}).
204 \end{tsremark}
205
206
207 \begin{tsremark}[Note 2:]
208 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
209 \end{tsremark}
210
211 \begin{codedescribe}{\starray_def_from_keyval:nn,\starray_def_from_keyval:nnTF}
212 \begin{codesyntax}%
213 \tsmacro{\starray_def_from_keyval:nn}{starray-ref,keyval-lst}
214 \tsmacro{\starray_def_from_keyval:nnTF}{starray-ref,keyval-lst,if-true,if-false}
215 \end{codesyntax}
216
217 Adds a set of \tsobj[marg]{keys} / \tsobj[marg]{values} and/or \tsobj[marg]{structures} to \tsobj[marg]{starray-ref} (see \ref{pack:ref}). The \tsobj[marg]{keyval-lst} is pretty straightforward,
218 the construction \tsobj[key]{\tsobj[marg]{key} . struct} denotes a nested structure :
219 \end{codedescribe}
220
221 \begin{codestore}[keyval.demo]
222 \starray_def_from_keyval:nn {root.substructure}
223 {
224 keyA = valA ,
225 keyB = valB ,
226 subZ . struct =
227 {
228 keyZA = valZA ,
229 keyZB = valZB ,
230 }
231 subY . struct =
232 {
233 keyYA = valYA ,
234 keyYB = valYB ,
235 subYYY . struct =
236 {
237 keyYYYa = valYYYa ,
238 keyYYYb = valYYYb
239 }
240 }
241 }
242 \end{codestore}
243
244 \tscode*[starray]{keyval.demo}
245
246 The definitions/assignments to \tsobj[marg]{starray-ref} are all global.
247
248 \begin{tsremark}
249 The non-branching version raises a warning (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning. Also note that, syntax errors on the \tsobj[marg]{keyval-lst} might raise low level (\TeX) errors.
250 \end{tsremark}
251
252 \subsection{Fixing an ill-instantiated starray}\label{pack:def-fix}
253
254 When instantiating (see \ref{pack:instantiate}) a \tsobj[pkg]{starray}, the associated structure will be constructed based on it's ``current definition'' (see \ref{pack:def}). A problem that might arise, when one extends the definition of an already instantiated \tsobj[pkg]{starray} (better said, if one adds a sub-structure to it), is that a \textsl{quark loop} will issue (from \tsobj[pkg]{l3quark}). To avoid that \textsl{quark loop} it is necessary to ``fix'' the structure of the already instantiated terms.
255
256 \begin{codedescribe}{\starray_fix_terms:n}
257 \begin{codesyntax}%
258 \tsmacro{\starray_fix_terms:n}{starray-ref}
259 \end{codesyntax}
260 The sole purpose of this function is to ``fix'' the already instantiated terms of a \tsobj[pkg]{starray}. Note, the reason this isn't automatically executed when adding a sub-structure, is that this is an expensive operation, because it has to craw over all the terms of an instantiated \tsobj[pkg]{starray} adding any missing sub-structure reference, but one doesn't need to run it ``right away'' it is possible to add a bunch of sub-structures and then run this just once.
261 \end{codedescribe}
262
263
264 \section{Instantiating starray Terms}\label{pack:instantiate}
265
266 \begin{codedescribe}{\starray_new_term:n,\starray_new_term:nn,\starray_new_term:nTF,\starray_new_term:nnTF}
267 \begin{codesyntax}%
268 \tsmacro{\starray_new_term:n}{starray-ref}
269 \tsmacro{\starray_new_term:nn}{starray-ref,hash}
270 \tsmacro{\starray_new_term:nTF}{starray-ref,if-true,if-false}
271 \tsmacro{\starray_new_term:nnTF}{starray-ref,hash,if-true,if-false}
272 \end{codesyntax}
273 This create a new \textsl{term} (in fact a property list) of the (sub-)struture referenced by \tsobj[marg]{starray-ref}. Note that the newly created \textsl{term} will have all properties (key/values) as defined by the associated \tsmacro{\starray_prop_def:nn}{starray-ref}, with the respective ``initial values''. For instance, given the following
274 \end{codedescribe}
275
276 \begin{codestore}[store-env=keyval.demo2]
277 \starray_new:n {st-root}
278
279 \starray_def_from_keyval:nn {st-root}
280 {
281 keyA = valA ,
282 keyB = valB ,
283 subZ . struct =
284 {
285 keyZA = valZA ,
286 keyZB = valZB ,
287 }
288 subY . struct =
289 {
290 keyYA = valYA ,
291 keyYB = valYB ,
292 subYYY . struct =
293 {
294 keyYYYa = valYYYa ,
295 keyYYYb = valYYYb
296 }
297 }
298 }
299
300 \starray_new_term:n {st-root}
301 \starray_new_term:n {st-root.subZ}
302 \starray_new_term:n {st-root.subZ}
303 \starray_new_term:n {st-root.subY}
304 \starray_new_term:nn {st-root}{hash-A}
305 \starray_new_term:n {st-root.subZ}
306 \end{codestore}
307
308 \tscode*[starray]{keyval.demo2}
309
310 One will have created 6 \textsl{terms}:
311 \begin{enumerate}[miditemsep]
312 \item 2 \tsobj[marg]{st-root} \textsl{terms}
313 \begin{enumerate}[miditemsep]
314 \item the first one with index 1 and
315 \begin{enumerate}[miditemsep]
316 \item 2 sub-structures \tsobj[marg]{subZ} (indexes 1 and 2)
317 \item 1 sub-structure \tsobj[marg]{subY} (index 1)
318 \end{enumerate}
319 \item the second one with indexes 2 and ``hash-A'' and
320 \begin{enumerate}[miditemsep]
321 \item 1 sub-structure \tsobj[marg]{subZ} (index 1)
322 \end{enumerate}
323 \end{enumerate}
324 \end{enumerate}
325
326 Note that, in the above example, it was used the ``implicit'' indexing (aka. iterator, see \ref{pack:ref}). Also note that no \textsl{term} \tsobj[marg]{subYYY} was created.
327 \begin{tsremark}
328 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
329 \end{tsremark}
330
331 \subsection{Referencing Terms}\label{pack:ref}
332
333 When typing a \tsobj[marg]{starray-ref} there are 3 cases to consider:
334 \begin{enumerate}[miditemsep]
335 \item structure definition
336 \item term instantiation
337 \item getting/setting a property
338 \end{enumerate}
339
340 The first case is the simplest one, in which, one (starting by \tsobj[marg]{starray-root} will use a construct like \tsobj[marg]{starray-root}.\tsobj[marg]{sub-struct}.\tsobj[marg]{sub-struct}\ldots
341 For example, an equivalent construct to the one shown in \ref{pack:instantiate} :
342
343 \begin{codestore}[store-env=demo3]
344 \starray_new:n {st-root}
345
346 \starray_def_struct:nn {st-root}{subZ}
347
348 \starray_def_prop:nnn {st-root}{keyA}{valA}
349 \starray_def_prop:nnn {st-root}{keyB}{valB}
350
351 \starray_def_prop:nnn {st-root.subZ}{keyZA}{valZA}
352 \starray_def_prop:nnn {st-root.subZ}{keyZB}{valZB}
353
354 \starray_def_struct:nn {st-root}{subY}
355 \starray_def_prop:nnn {st-root.subY}{keyYA}{valYA}
356 \starray_def_prop:nnn {st-root.subY}{keyYB}{valYB}
357
358 \starray_def_struct:nn {st-root.subY}{subYYY}
359 \starray_def_prop:nnn {st-root.subY.subYYY}{keyYYYA}{valYYYA}
360 \starray_def_prop:nnn {st-root.subY.subYYY}{keyYYYB}{valYYYB}
361
362 \end{codestore}
363
364 \tscode*[starray]{demo3}
365
366 Note that, all it's needed in order to be able to use \tsobj[marg]{starray-root}.\tsobj[marg]{sub-A} is that \tsobj[marg]{sub-A} is an already declared sub-structure of \tsobj[marg]{starray-root}. The property definitions can be made in any order.
367
368 In all other cases, term instantiation, getting/setting a property, one has to address/reference a specific instance/term, implicitly (using iterators) or explicitly using indexes.
369 The general form, of a \tsobj[marg]{starray-ref}, is: \par
370 \tsobj[marg]{starray-root}\tsobj[oarg]{idx}.\tsobj[marg]{sub-A}\tsobj[oarg]{idxA}.\tsobj[marg]{sub-B}\tsobj[oarg]{idxB} \par
371 In the case of term instantiation the last \tsobj[marg]{sub-} cannot be indexed, after all one is creating a new term/index. Moreover, all \tsobj[oarg]{idx} are optional like:\par
372 \tsobj[marg]{starray-root}.\tsobj[marg]{sub-A}\tsobj[oarg]{idxA}.\tsobj[marg]{sub-B} \par
373 in which case, one is using the ``iterator'' of \tsobj[marg]{starray-root} and \tsobj[marg]{sub-B} (more later, but keep in mind the \tsobj[marg]{sub-B} iterator is the \tsobj[marg]{sub-B} associated with the \tsobj[marg]{sub-A}\tsobj[oarg]{idxA}).
374
375 Since one has to explicitly instantiate all (sub)terms of a starray, one can end with a highly asymmetric structure. Starting at the \tsobj[marg]{starray-root} one has a first counter (representing, indexing the root structure terms), then for all sub-strutures of \tsobj[marg]{starray-root} one will have an additional counter for every term of \tsobj[marg]{starray-root} !
376
377 So, for example:
378 \begin{codestore}[store-env=demo4]
379 \starray_new:n {st-root}
380 \starray_def_struct:nn {st-root}{subZ}
381 \starray_def_struct:nn {st-root}{subY}
382 \starray_def_struct:nn {st-root.subY}{subYYY}
383
384 \starray_new_term:n {st-root}
385 \starray_new_term:n {st-root.subZ}
386 \starray_new_term:n {st-root.subZ}
387 \starray_new_term:n {st-root.subY}
388 \starray_new_term:n {st-root.subY}
389 \starray_new_term:n {st-root.subY.subYYY}
390 \starray_new_term:n {st-root.subY}
391
392 \starray_new_term:n {st-root}
393 \starray_new_term:n {st-root.subZ}
394 \starray_new_term:n {st-root.subZ}
395 \starray_new_term:n {st-root.subY}
396 \end{codestore}
397
398 \tscode*[starray]{demo4}
399
400 One has a single \tsobj[marg]{st-root} iterator (pointing to one of the 3 \tsobj[marg]{st-root} terms), then 3 ``\tsobj[marg]{subZ} iterators'', in fact, one \tsobj[marg]{subZ} iterator for each \tsobj[marg]{st-root} term.
401 Likewise there are 3 ``\tsobj[marg]{subY} iterators'' and 4 (four) ``\tsobj[marg]{subYYY} iterators'' one for each instance of \tsobj[marg]{subY}.
402
403 Every time a new term is created/instantiated, the corresponding iterator will points to it, which allows the notation used in this last example, keep in mind that one could instead, using explicit indexes:
404
405 \begin{codestore}[store-env=demo5]
406 \starray_new:n {st-root}
407 \starray_def_struct:nn {st-root}{subZ}
408 \starray_def_struct:nn {st-root}{subY}
409 \starray_def_struct:nn {st-root.subY}{subYYY}
410
411 \starray_new_term:n {st-root}
412 \starray_new_term:n {st-root[1].subZ}
413 \starray_new_term:n {st-root[1].subZ}
414 \starray_new_term:n {st-root[1].subY}
415 \starray_new_term:n {st-root[1].subY}
416 \starray_new_term:n {st-root[1].subY[2].subYYY}
417 \starray_new_term:n {st-root[1].subY}
418
419 \starray_new_term:n {st-root}
420 \starray_new_term:n {st-root[2].subZ}
421 \starray_new_term:n {st-root[2].subZ}
422 \starray_new_term:n {st-root[2].subY}
423 \end{codestore}
424
425 \tscode*[starray]{demo5}
426
427 Finally, observe that, when creating a new term, one has the option to assign a ``hash'' to it, in which case that term can be referred to using an iterator, the explicit index or the hash:
428
429 \begin{codestore}[store-env=demo6]
430 \starray_new:n {st-root}
431 \starray_def_struct:nn {st-root}{subZ}
432 \starray_def_struct:nn {st-root}{subY}
433 \starray_def_struct:nn {st-root.subY}{subYYY}
434
435 \starray_new_term:nn {st-root}{hash-A}
436 \starray_new_term:n {st-root.subZ}
437 \starray_new_term:n {st-root[1].subZ}
438 \starray_new_term:n {st-root[hash-A].subZ}
439 \end{codestore}
440 \tscode*[starray]{demo6}
441
442 Will create 3 \tsobj[marg]{subZ} terms associated with the first \tsobj[marg]{st-root} term (index = 1).
443
444
445 \subsection{Iterators}\label{pack:iter}
446 In the following commands, since version 2.0, when setting/resetting/incrementing the iterator of a (sub-)structure, only the given (sub-)structure iterator will be affected. With the package option \tsobj[option]{iter cascade} (see \ref{pack:options}) all ``descending'' iterators will also be reset to \tsobj[value,or]{1,0}. All assignments to a structure's iterator are global.
447
448
449 \begin{codedescribe}[code,update=2026/02/01]{\starray_set_iter:nn,\starray_set_iter:nnTF,\starray_reset_iter:nn,\starray_reset_iter:nTF,\starray_next_iter:n,\starray_next_iter:nnTF}
450 \begin{codesyntax}%
451 \tsmacro{\starray_set_iter:nn}{starray-ref,int-val}
452 \tsmacro{\starray_set_iter:nTF}{starray-ref,int-val,if-true,if-false}
453 \tsmacro{\starray_reset_iter:n}{starray-ref}
454 \tsmacro{\starray_reset_iter:nTF}{starray-ref,if-true,if-false}
455 \tsmacro{\starray_next_iter:n}{starray-ref}
456 \tsmacro{\starray_next_iter:nTF}{starray-ref,if-true,if-false}
457 \end{codesyntax}
458 Those functions allows to \tsmacro{set}{} an iterator to a given value, \tsobj[marg]{int-val}, \tsmacro{reset}{} it (i.e. assign 1 to it), or increase the iterator by one. An iterator might have a value between 1 and the number of instantiated terms. If the (sub-)structure wasn't instantiated, the iterator will be set to 0. The branching versions allows to catch those cases, like trying to set a value past its maximum, or a value smaller than one, otherwise values outside the valid range won't raise any warning/error.
459 \end{codedescribe}
460
461 %\begin{tsremark}[\color{red}Important:]
462 %Please observe that, when setting/resetting/incrementing the iterator of a (sub-)structure, all ``descending'' iterators will also be reset.
463 %\end{tsremark}
464 \begin{tsremark}
465 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
466 \end{tsremark}
467
468 In the following example, given:
469
470 \begin{codestore}[demo7]
471 \starray_new:n {st-root}
472 \starray_def_struct:nn {st-root}{subZ}
473 \starray_def_struct:nn {st-root}{subY}
474 \starray_def_struct:nn {st-root.subY}{subYYY}
475 \end{codestore}
476
477 \begin{codestore}[demo7]
478 \starray_new_term:n {st-root}
479 \starray_new_term:n {st-root.subZ}
480 \starray_new_term:n {st-root.subZ}
481 \starray_new_term:n {st-root.subY}
482 \starray_new_term:n {st-root.subY.subYYY}
483 \starray_new_term:n {st-root.subY.subYYY}
484 \starray_new_term:n {st-root.subY}
485 \starray_new_term:n {st-root.subY.subYYY}
486 \starray_new_term:n {st-root.subY.subYYY}
487 \starray_new_term:n {st-root}
488 \starray_new_term:n {st-root.subZ}
489 \starray_new_term:n {st-root.subZ}
490 \starray_new_term:n {st-root.subY}
491 \starray_new_term:n {st-root.subY.subYYY}
492 \starray_new_term:n {st-root.subY.subYYY}
493 \starray_new_term:n {st-root.subY}
494 \starray_new_term:n {st-root.subY.subYYY}
495 \starray_new_term:n {st-root.subY.subYYY}
496 \end{codestore}
497
498 \begin{codestore}[demo7]
499 \starray_set_prop:nnn {st-root.subY.subYYY}{key}{val}
500 \starray_set_prop:nnn {st-root[2].subY[2].subYYY[2]}{key}{val}
501
502 \starray_reset_iter:n {st-root[2].subY}
503
504 \starray_set_prop:nnn {st-root.subY.subYYY}{key}{val}
505 \starray_set_prop:nnn {st-root[2].subY[1].subYYY[1]}{key}{val}
506 \end{codestore}
507
508 \tscode*[starray,emph=[3]{starray_reset_iter},emph={starray_set_prop}]{demo7}
509 \tscode*[starray,emph=[3]{starray_reset_iter},emph={starray_set_prop}]{demo7}[2]
510 \tscode*[starray,emph=[3]{starray_reset_iter},emph={starray_set_prop}]{demo7}[3]
511
512 Before the reset \tsobj[marg]{st-root.subY.subYYY} was equivalent to \tsobj[marg]{st-root[2].subY[2].subYYY[2]}, given that each iterator was pointing to the ``last term'', since the reset was of the \tsobj[marg]{subY} iterator, only it reset, and therefore \tsobj[marg]{st-root.subY.subYYY} was then equivalent to \tsobj[marg]{st-root[2].subY[1].subYYY[2]}.
513 \begin{tsremark}
514 With the package option \tsobj[option]{iter cascade} all sub-structure's iterators will also be set/reset, meaning, in the above example, that after resetting the \tsobj[marg]{subY}, the iterator of \tsobj[marg]{subYYY} (it's only descendant) will also be reset, therefore \tsobj[marg]{st-root.subY.subYYY} would be equivalent to \tsobj[marg]{st-root[2].subY[1].subYYY[1]} in this case.
515 \end{tsremark}
516
517
518
519 \begin{codedescribe}[code,new=2023/11/04]{\starray_set_iter_from_hash:nn,\starray_set_iter_from_hash:nnTF}
520 \begin{codesyntax}%
521 \tsmacro{\starray_set_iter_from_hash:nn}{starray-ref,hash}
522 \tsmacro{\starray_set_iter_from_hash:nnTF}{starray-ref,hash,if-true,if-false}
523 \end{codesyntax}
524 \tsmacro{\starray_set_iter_from_hash:nn}{starray-ref,hash} will set iter based on the \tsobj[meta]{hash} used when instantiating a term (see \ref{pack:instantiate} ).
525 \end{codedescribe}
526 \begin{tsremark}
527 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error or invalid \tsobj[meta]{hash}. The branching version doesn't raise any warning.
528 \end{tsremark}
529
530
531 \begin{codedescribe}{\starray_get_iter:n,\starray_get_iter:nN,\starray_get_iter:nNTF}
532 \begin{codesyntax}%
533 \tsmacro{\starray_get_iter:n}{starray-ref}
534 \tsmacro{\starray_get_iter:nN}{starray-ref,int-var}
535 \tsmacro{\starray_get_iter:nNTF}{starray-ref,int-var,if-true,if-false}
536 \end{codesyntax}
537 \tsmacro{\starray_get_iter:n}{starray-ref} will type in the current value of a given iterator, whilst the other two functions will save it's value in a integer variable (\tsobj[pkg]{expl3}\cite{expl3}). The assignment is local.
538
539 \end{codedescribe}
540 \begin{tsremark}
541 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
542 \end{tsremark}
543
544
545
546
547 \begin{codedescribe}{\starray_get_cnt:n,\starray_get_cnt:nN,\starray_get_cnt:nNTF}
548 \begin{codesyntax}%
549 \tsmacro{\starray_get_cnt:n}{starray-ref}
550 \tsmacro{\starray_get_cnt:nN}{starray-ref,integer}
551 \tsmacro{\starray_get_cnt:nNTF}{starray-ref,integer,if-true,if-false}
552 \end{codesyntax}
553 \tsmacro{\starray_get_cnt:n}{starray-ref} will type in the current number of terms of a given (sub-)structure, whilst the other two functions will save it's value in a integer variable (\tsobj[pkg]{expl3}\cite{expl3}). The assignment is local.
554
555 \end{codedescribe}
556 \begin{tsremark}
557 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
558 \end{tsremark}
559
560 \subsubsection{Iterating Over}
561 \begin{codedescribe}[code,new=2023/11/04,update=2026/02/01]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}
562 \begin{codesyntax}%
563 \tsmacro{\starray_iterate_over:nn}{starray-ref,code}
564 \tsmacro{\starray_iterate_over:nnTF}{starray-ref,code,if-true,if-false}
565 \end{codesyntax}
566 \tsobj{\starray_iterate_over:nn} will reset the \tsobj[marg]{starray-ref} iterator, and then execute \tsobj[marg]{code} for each valid value of \tsobj{iter}. At the loop's end, the \tsobj[marg]{starray-ref} iterator will point to the last element of it. The \tsobj[marg]{if-true} is executed, at the loop's end if there is no syntax error, and the referenced structure was properly instantiated. Similarly \tsobj[marg]{if-false} is only execute if a syntax error is detected or the referenced structure wasn't properly instantiated. See \ref{parsed:iter-over} for a series of helper/companion commands when writing \tsobj[marg]{code}.
567 \end{codedescribe} \label{iterate-over}
568 \begin{tsremark}
569 \tsobj{\starray_iterate_over:nn} is recurse aware, and can be nested to recurse over sub-structures. Be aware, though, that all iterators assignments are global. \end{tsremark}
570 \begin{tsremark}
571 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error or the structure wasn't yet instantiated. The branching version doesn't raise any warning.
572 \end{tsremark}
573
574
575
576 \section{Changing and Recovering starray Properties}\label{pack:get/set}
577
578 \begin{codedescribe}{\starray_set_prop:nnn,\starray_set_prop:nnV,\starray_set_prop:nnnTF,\starray_set_prop:nnVTF,\starray_gset_prop:nnn,\starray_gset_prop:nnV,\starray_gset_prop:nnnTF,\starray_gset_prop:nnVTF}
579 \begin{codesyntax}%
580 \tsmacro{\starray_set_prop:nnn}{starray-ref,prop-key,value}
581 \tsmacro{\starray_set_prop:nnV}{starray-ref,prop-key,value}
582 \tsmacro{\starray_set_prop:nnnTF}{starray-ref,prop-key,value,if-true,if-false}
583 \tsmacro{\starray_set_prop:nnVTF}{starray-ref,prop-key,value,if-true,if-false}
584 \tsmacro{\starray_gset_prop:nnn}{starray-ref,prop-key,value}
585 \tsmacro{\starray_gset_prop:nnV}{starray-ref,prop-key,value}
586 \tsmacro{\starray_gset_prop:nnnTF}{starray-ref,prop-key,value,if-true,if-false}
587 \tsmacro{\starray_gset_prop:nnVTF}{starray-ref,prop-key,value,if-true,if-false}
588 \end{codesyntax}
589 Those are the functions that allow to (g)set (change) the value of a term's property. If the \tsobj[marg]{prop-key} isn't already present it will be added to that term, \tsobj[marg]{starray-ref}, only. The \tsobj[parg]{nnV} variants allow to save the value of a variable like a token list, clist list, etc...
590 \end{codedescribe}
591
592 \begin{tsremark}
593 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
594 \end{tsremark}
595
596 \begin{codedescribe}{\starray_set_from_keyval:nn,\starray_set_from_keyval:nnTF,\starray_gset_from_keyval:nn,\starray_gset_from_keyval:nnTF}
597 \begin{codesyntax}%
598 \tsmacro{\starray_set_from_keyval:nnn}{starray-ref,keyval-lst}
599 \tsmacro{\starray_set_from_keyval:nnnTF}{starray-ref,keyval-lst,if-true,if-false}
600 \tsmacro{\starray_gset_from_keyval:nnn}{starray-ref,keyval-lst}
601 \tsmacro{\starray_gset_from_keyval:nnnTF}{starray-ref,keyval-lst,if-true,if-false}
602 \end{codesyntax}
603 it is possible to set a collection of properties using a key/val syntax, similar to the one used to define a \tsobj[pkg]{starray} from keyvals (see \ref{pack:def}), with a few distinctions:
604 \begin{enumerate}
605 \item when referring a (sub-)structure one can either explicitly use an index, or
606 \item implicitly use it's iterator
607 \item if a given key isn't already presented it will be added only to the given term
608 \end{enumerate}
609 Note that, in the following example, TWO iterators are being used, the one for \tsobj[marg]{st-root} and then \tsobj[marg]{subY}.
610 \end{codedescribe}
611
612
613
614 \begin{codestore}[store-env=keyval.demo8]
615 \starray_set_from_keyval:nn {st-root}
616 {
617 keyA = valA ,
618 keyB = valB ,
619 subZ[2] =
620 {
621 keyZA = valZA ,
622 keyZB = valZB ,
623 }
624 subY =
625 {
626 keyYA = valYA ,
627 keyYB = valYB ,
628 subYYY[1] =
629 {
630 keyYYYa = valYYYa ,
631 keyYYYb = valYYYb
632 }
633 }
634 }
635 \end{codestore}
636
637 \tscode*[starray]{keyval.demo8}
638
639 Also note that the above example is fully equivalent to:
640
641 \begin{codestore}[store-env=keyval.demo9]
642 \starray_set_prop:nnn {st-root} {keyA} {valA}
643 \starray_set_prop:nnn {st-root} {keyB} {valB}
644 \starray_set_prop:nnn {st-root.subZ[2]} {keyZA} {valZA}
645 \starray_set_prop:nnn {st-root.subZ[2]} {keyZB} {valZB}
646 \starray_set_prop:nnn {st-root.subY} {keyYA} {valYA}
647 \starray_set_prop:nnn {st-root.subY} {keyYB} {valYB}
648 \starray_set_prop:nnn {st-root.subY.subYYY[1} {keyYYYa} {valYYYa}
649 \starray_set_prop:nnn {st-root.subY.subYYY[1} {keyYYYb} {valYYYb}
650 \end{codestore}
651
652 \tscode*[starray]{keyval.demo9}
653
654 \begin{codedescribe}{\starray_get_prop:nn,\starray_get_prop:nnN,\starray_get_prop:nnNTF}
655 \begin{codesyntax}%
656 \tsmacro{\starray_get_prop:nn}{starray-ref,key}
657 \tsmacro{\starray_get_prop:nnN}{starray-ref,key,tl-var}
658 \tsmacro{\starray_get_prop:nnNTF}{starray-ref,key,tl-var,if-true,if-false}
659 \end{codesyntax}
660 \tsmacro{\starray_get_prop:nn}{starray-ref,key} places the value of \tsobj[marg]{key} in the input stream. \break
661 \tsmacro{\starray_get_prop:nnN}{starray-ref,key,tl-var} recovers the value of \tsobj[marg]{key} and places it in \tsobj[marg]{tl-var} (a token list variable), this is specially useful in conjunction with \tsobj{\starray_set_prop:nnV}, whilst the \tsobj{\starray_get_prop:nnNTF} version branches accordly. The assignment is local.
662 \end{codedescribe}
663 \begin{tsremark}
664 In case of a syntax error, or \tsobj[marg]{key} doesn't exist, an empty value is left in the stream (or \tsobj[marg]{tl-var}).
665 \end{tsremark}
666 \begin{tsremark}
667 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
668 \end{tsremark}
669
670
671 \section{Additional Commands and Conditionals}\label{conditionals:terms}
672
673 \begin{codedescribe}{\starray_if_in:nnTF}
674 \begin{codesyntax}%
675 \tsmacro{\starray_if_in:nnTF}{starray-ref,key,if-true,if-false}
676 \end{codesyntax}
677 The \tsmacro{\starray_if_in:nnTF}{starray-ref,key,\ldots,\ldots} tests if a given \tsobj[marg]{key} is present.
678 \end{codedescribe}
679
680 \begin{codedescribe}[code,new=2024/03/10]{\starray_get_unique_id:nN,\starray_get_unique_id:nNTF}
681 \begin{codesyntax}%
682 \tsmacro{\starray_get_unique_id:nN}{starray-ref,tl-var}
683 \tsmacro{\starray_get_unique_id:nNTF}{starray-ref,tl-var,if-true,if-false}
684 \end{codesyntax}
685 Gets an `unique ID' for a given \tsobj[marg]{starray-ref} \emph{term}, it should help defining/creating uniquely identified auxiliary structures, like auxiliary property or sequence lists, since one can't (better said shouldn't, as per l3kernel) store an anonymous property/sequence list using V-expansion. The assignment is local.
686
687 \end{codedescribe}
688 \begin{tsremark}
689 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning.
690 \end{tsremark}
691
692 \section{Parsed Commands}\label{pack:parsed}
693 Since the parsing of a \tsobj[marg]{starray-ref} is a non-expandable and expensive operation, the commands below allow for some coding speed up (by avoiding parsing the same \tsobj[marg]{starray-ref} repeatedly) and offers expandable alternatives for a few commands.
694
695 The use pattern would be (1) to first parse the \tsobj[marg]{starray-ref} with either \tsobj[code,sep=or]{\starray_term_parser:n,\starray_term_parser:nN} and thereafter (2) use the many \tsobj[code,or]{\starray_parsed_,\starray_uparsed_} commands.
696
697 Note that, there are three sets of commands, one associated with \tsobj[code,sep=and/or]{\starray_term_parser:n,\starray_term_parser:nTF}{} (which relies on internal variables), another set associated with \tsobj[code,sep=and/or]{\starray_term_parser:nN,\starray_term_parser:nNTF} (which allows to save more than one \tsobj[marg]{starray-ref} parsed term), and lastly one associated with \tsobj[code,or]{\starray_iterate_over:nn} (see \ref{iterate-over}).
698
699
700 \subsection{Parsed Commands Based on Internal Variables}\label{parsed:internal}
701 \begin{codedescribe}[code,new=2023/05/20,update=2025/10/25]{\starray_term_parser:n,\starray_term_parser:nTF}
702 \begin{codesyntax}%
703 \tsmacro{\starray_term_parser:n}{starray-ref}
704 \tsmacro{\starray_term_parser:nTF}{starray-ref,if-true,if-false}
705 \end{codesyntax}
706 In case one needs to access the same term again and again, this will just parse a \tsobj[marg]{starray-ref} reference once, and set interval variables so that commands like \tsobj{\starray_parsed_} can be used thereafter (avoiding having to slowly parse the same term over and over).
707 \end{codedescribe}
708 \begin{tsremark}
709 The internal variables used are exclusive, no other command (besides these two), set them. This allows to ``parse a term'' and call other \tsobj{\starray_} commands before using the ``parsed term'' with one of the \tsobj{\starray_parsed_} commands.
710 \end{tsremark}
711 \begin{tsremark}[\color{red}Warning:]
712 While it allows for some code speedup, and enables some commands to be fully expandable, be aware that the internal variables will only be set correctly if, and only if, the \tsobj[marg]{starray-ref} is a valid term reference.
713 \end{tsremark}
714 \begin{tsremark}
715 By default, the many associated \tsobj{\starray_parsed_} won't check the status of the last \tsobj{\starray_term_parser:n} operation. This can be changed with the package option \tsobj[option]{parsed check} (see \ref{pack:options}) in which case all associated \tsobj{\starray_parsed_} will then verify the status of the last operation and raise a warning/error.
716 \end{tsremark}
717 \begin{tsremark}
718 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error, in which case the internal variables won't be set correctly. The branching version doesn't raise any warning.
719 \end{tsremark}
720 \begin{tsremark}
721 The \tsobj{\starray_term_syntax:n,\starray_term_syntax:nTF} have been deprecated (version 1.11), a warning is raised if a deprecated one is called.
722 \end{tsremark}
723
724 \begin{codedescribe}[code,EXP,new=2023/05/20]{\starray_parsed_if_in_p:n,\starray_parsed_if_in:nTF}
725 \begin{codesyntax}%
726 \tsmacro{\starray_parsed_if_in_p:nTF}{key}
727 \tsmacro{\starray_parsed_if_in:nTF}{key,if-true,if-false}
728 \end{codesyntax}
729 This will test if the given \tsobj[key]{key} is present in the ``last parsed term''.
730 \end{codedescribe}
731 \begin{tsremark}
732 The predicate version, \tsobj{_p}, expands to either \tsobj{\c_true_bool} or \break \tsobj{\c_false_bool}.
733 \end{tsremark}
734 \begin{tsremark}[\color{red}Warning:]
735 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
736 \end{tsremark}
737
738
739 \begin{codedescribe}[code,EXP,new=2023/05/20]{\starray_parsed_get_iter:}
740 \begin{codesyntax}%
741 \tsobj{\starray_parsed_get_iter:}{}
742 \end{codesyntax}
743 \tsobj{\starray_parsed_get_iter:} will place in the current iterator's value, using \tsobj{\int_use:N}, of the last parsed term in the input stream.
744 \end{codedescribe}
745 \begin{tsremark}[\color{red}Warning:]
746 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
747 \end{tsremark}
748
749 \begin{codedescribe}[code,new=2025/10/25]{\starray_parsed_get_iter:N,\starray_parsed_get_iter:NTF}
750 \begin{codesyntax}%
751 \tsmacro{\starray_parsed_get_iter:N}{int-var}
752 \tsmacro{\starray_parsed_get_iter:NTF}{int-var,if-true,if-false}
753 \end{codesyntax}
754 These will save the iterator’s value (of a parsed term) in a integer variable (\tsobj[pkg]{expl3}\cite{expl3}). The \tsobj[marg]{if-true,if-false} regards the status of the last \tsobj{\starray_term_parser:} command, iff the option \tsobj[option]{parsed check} (see \ref{pack:options}) is enable, otherwise it will always execute the \tsobj[marg]{if-true} branch.
755 \end{codedescribe}
756 \begin{tsremark}[\color{red}Warning:]
757 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
758 \end{tsremark}
759
760 \begin{codedescribe}[code,EXP,new=2023/05/20]{\starray_parsed_get_cnt:}
761 \begin{codesyntax}%
762 \tsobj{\starray_parsed_get_cnt:}{}
763 \end{codesyntax}
764 \tsobj{\starray_parsed_get_cnt:} will place the current number of terms, using \tsobj{\int_use:N}, of the last parsed term, in the input stream.
765 \end{codedescribe}
766 \begin{tsremark}[\color{red}Warning:]
767 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
768 \end{tsremark}
769
770 \begin{codedescribe}[code,new=2025/10/25]{\starray_parsed_get_cnt:N,\starray_parsed_get_cnt:NTF}
771 \begin{codesyntax}%
772 \tsmacro{\starray_get_cnt:N}{integer}
773 \tsmacro{\starray_get_cnt:NTF}{integer,if-true,if-false}
774 \end{codesyntax}
775 Similarly to \tsobj{\starray_get_cnt:nN,\starray_get_cnt:nNTF} these will save the number of terms (of the last parsed term) in a integer variable (\tsobj[pkg]{expl3}\cite{expl3}). The \tsobj[marg]{if-true,if-false} regards the status of the last \tsobj{\starray_term_parser:} command, iff the option \tsobj[option]{parsed check} (see \ref{pack:options}) is enable, otherwise it will always execute the \tsobj[marg]{if-true} branch.
776 \end{codedescribe}
777 \begin{tsremark}[\color{red}Warning:]
778 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
779 \end{tsremark}
780
781
782
783
784 \begin{codedescribe}[code,EXP,new=2023/05/20]{\starray_parsed_get_prop:n}
785 \begin{codesyntax}%
786 \tsmacro{\starray_parsed_get_prop:n}{key}
787 \end{codesyntax}
788 \tsmacro{\starray_parsed_get_prop:n}{key} places the value of \tsobj[marg]{key}, if it exists, from the last parsed term, in the input stream.
789 \end{codedescribe}
790 \begin{tsremark}[\color{red}Warning:]
791 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
792 \end{tsremark}
793
794 \begin{codedescribe}[code,new=2025/10/25]{\starray_parsed_get_prop:nN,\starray_parsed_get_prop:nNTF}
795 \begin{codesyntax}%
796 \tsmacro{\starray_parsed_get_prop:nN}{key,tl-var}
797 \tsmacro{\starray_parsed_get_prop:nNTF}{key,tl-var,if-true,if-false}
798 \end{codesyntax}
799 \tsmacro{\starray_parsed_get_prop:nN}{key,tl-val} stores the value of \tsobj[marg]{key}, if it exists, from the last parsed term. The \tsobj[marg]{if-false} branch is executed if \tsobj[marg]{key} doesn't exist or (if the option \tsobj[option]{parsed check}, see \ref{pack:options}, is enabled) if the last parser operation has failed.
800 \end{codedescribe}
801 \begin{tsremark}[\color{red}Warning:]
802 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
803 \end{tsremark}
804
805 \begin{codedescribe}[code,new=2025/10/25]{\starray_parsed_get_unique_id:nN,\starray_parsed_get_unique_id:nNTF}
806 \begin{codesyntax}%
807 \tsmacro{\starray_parsed_get_unique_id:nN}{tl-var}
808 \tsmacro{\starray_parsed_get_unique_id:nNTF}{tl-var,if-true,if-false}
809 \end{codesyntax}
810 Gets an `unique ID' from the last parsed term. The \tsobj[marg]{if-true,if-false} regards the status of the last \tsobj{\starray_term_parser:} command, iff the option \tsobj[option]{parsed check} (see \ref{pack:options}) is enable, otherwise it will always execute the \tsobj[marg]{if-true} branch.
811 \end{codedescribe}
812 \begin{tsremark}[\color{red}Warning:]
813 This can only be used after \tsobj{\starray_term_parser:n} and only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed.
814 \end{tsremark}
815
816
817 \subsection{Parsed Commands Based on User Variables}\label{parsed:user-var}
818
819 Due to internal changes, since version 1.12, there is no longer the need to use two variables to save an `internal reference', though just reducing the signatures of the original \tsobj{_parsed_} commands by one N resulted in some name crashing which, unfortunately, obliged a series of commands renaming, as follows: all commands related in this section now are named \tsobj{\starray_uparsed_} so they are completely distinct from those commands from the previous section, \ref{parsed:internal}. By default, only the new names are defined. Using the package option \tsobj[option]{NN names}, see \ref{pack:options}, the old command names get also defined. With \tsobj[option]{NN names = strict} the old commands will issue an warning pointing to the new names (this might result in low level errors if the commands are used in an expansion context). With \tsobj[option]{NN names = no warnings} the old commands won't issue any warning about their use.
820
821 \begin{codedescribe}[code,new=2023/11/28,update=2025/10/25,update=2025/12/08]{\starray_term_parser:nN,\starray_term_parser:nNTF}
822 \begin{codesyntax}%
823 \tsmacro{\starray_term_parser:nN}{starray-ref,parsed-refA}
824 \tsmacro{\starray_term_parser:nNTF}{starray-ref,parsed-refA,if-true,if-false}
825 \end{codesyntax}
826 \tsobj[marg]{parsed-refA} (assumed to be a token list variable, \tsobj[meta]{tl-var}) will receive an `internal reference' that can be used in commands like \tsobj{\starray_uparsed_...:N} which expects such `reference'. The assignment is global.
827 \end{codedescribe}
828 \begin{tsremark}
829 Once correctly parsed, \tsobj[marg]{parsed-refA} can be used at 'any time' (by those few \tsobj{\starray_uparsed_...:N} associated commands).\end{tsremark}
830 \begin{tsremark}
831 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error (in which case \tsobj[marg]{parsed-refA} will not hold a valid value). The branching version doesn't raise any warning.
832 \end{tsremark}
833 \begin{tsremark}
834 Commands \tsobj{\starray_term_parser:nNN,\starray_term_parser:nNNTF}, besides \tsobj{\starray_term_syntax:nNN,\starray_term_syntax:nNNTF}, have been deprecated (versions 1.11 and 1.12), a warning is raised if a deprecated one is called.
835 \end{tsremark}
836
837
838
839
840 \begin{codedescribe}[code,EXP,new=2023/11/28,update=2025/12/08]{\starray_uparsed_if_in_p:Nn,\starray_uparsed_if_in:NnTF}
841 \begin{codesyntax}%
842 \tsmacro{\starray_uparsed_if_in_p:nTF}{parsed-refA,key}
843 \tsmacro{\starray_uparsed_if_in:nTF}{parsed-refA,key,if-true,if-false}
844 \end{codesyntax}
845 This will test if the given \tsobj[key]{key} is present/associated with \tsobj[marg]{parsed-refA}.
846 \end{codedescribe}
847 \begin{tsremark}
848 The predicate version, \tsobj{_p}, expands to either \tsobj[code,sep=or]{\c_true_bool,\c_false_bool}.
849 \end{tsremark}
850 \begin{tsremark}[\color{red}Warning:]
851 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
852 \end{tsremark}
853
854
855 \begin{codedescribe}[code,EXP,new=2023/11/28,update=2025/12/08]{\starray_uparsed_get_iter:N}
856 \begin{codesyntax}%
857 \tsmacro{\starray_uparsed_get_iter:N}{parsed-refA}
858 \end{codesyntax}
859 \tsobj{\starray_uparsed_get_iter:} will place in the current iterator's value associated with \tsobj[marg]{parsed-refA}, using \tsobj{\int_use:N}, in the input stream.
860 \end{codedescribe}
861 \begin{tsremark}[\color{red}Warning:]
862 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
863 \end{tsremark}
864
865 \begin{codedescribe}[code,new=2025/10/25,update=2025/12/08]{\starray_uparsed_get_iter:NN,\starray_uparsed_get_iter:NNTF}
866 \begin{codesyntax}%
867 \tsmacro{\starray_uparsed_get_iter:NN}{parsed-refA,int-var}
868 \tsmacro{\starray_uparsed_get_iter:NNTF}{parsed-refA,int-var,if-true,if-false}
869 \end{codesyntax}
870 These will save the iterator’s value in a \tsobj[marg]{int-var}. The \tsobj{\starray_uparsed_get_iter:NNTF} is for symmetry only (with other commands), it will always execute the \tsobj[marg]{if-true}.
871 \end{codedescribe}
872 \begin{tsremark}[\color{red}Warning:]
873 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
874 \end{tsremark}
875
876
877
878 \begin{codedescribe}[code,EXP,new=2023/11/28,update=2025/12/08]{\starray_uparsed_get_cnt:N}
879 \begin{codesyntax}%
880 \tsmacro{\starray_uparsed_get_cnt:N}{parsed-refA}
881 \end{codesyntax}
882 \tsobj{\starray_uparsed_get_cnt:} will place in the current number of terms associated with \tsobj[marg]{parsed-refA}, using \tsobj{\int_use:N}, in the input stream.
883 \end{codedescribe}
884 \begin{tsremark}[\color{red}Warning:]
885 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
886 \end{tsremark}
887
888 \begin{codedescribe}[code,new=2025/10/25,update=2025/12/08]{\starray_uparsed_get_cnt:NN,\starray_uparsed_get_cnt:NNTF}
889 \begin{codesyntax}%
890 \tsmacro{\starray_get_cnt:NN}{parsed-refA,int-var}
891 \tsmacro{\starray_get_cnt:NNTF}{parsed-refA,int-var,if-true,if-false}
892 \end{codesyntax}
893 Similarly to \tsobj{\starray_get_cnt:nN,\starray_get_cnt:nNTF} these will save the number of terms in \tsobj[marg]{int-var}. The \tsobj{\starray_uparsed_get_cnt:NNTF} is for symmetry only (with other commands), it will always execute the \tsobj[marg]{if-true}.
894 \end{codedescribe}
895 \begin{tsremark}[\color{red}Warning:]
896 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
897 \end{tsremark}
898
899
900
901 \begin{codedescribe}[code,EXP,new=2023/11/28,update=2025/12/08]{\starray_uparsed_get_prop:Nn}
902 \begin{codesyntax}%
903 \tsmacro{\starray_uparsed_get_prop:Nn}{parsed-refA,key}
904 \end{codesyntax}
905 \tsobj{\starray_uparsed_get_prop:Nn} places the value of \tsobj[marg]{key}, if it exists, associated with \tsobj[marg]{parsed-refA}.
906 \end{codedescribe}
907 \begin{tsremark}[\color{red}Warning:]
908 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
909 \end{tsremark}
910
911
912 \begin{codedescribe}[code,new=2025/10/25,update=2025/12/08]{\starray_uparsed_get_prop:NnN,\starray_uparsed_get_prop:NnNTF}
913 \begin{codesyntax}%
914 \tsmacro{\starray_uparsed_get_prop:NnN}{parsed-refA,key,tl-var}
915 \tsmacro{\starray_uparsed_get_prop:NnNTF}{parsed-refA,key,tl-var,if-true,if-false}
916 \end{codesyntax}
917 \tsmacro{\starray_uparsed_get_prop:NnN}{key,tl-val} stores the value of \tsobj[marg]{key}, if it exists, from the parsed term.
918 \end{codedescribe}
919 \begin{tsremark}[\color{red}Warning:]
920 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
921 \end{tsremark}
922
923 \begin{codedescribe}[code,new=2025/10/25,update=2025/12/08]{\starray_uparsed_get_unique_id:NN,\starray_uparsed_get_unique_id:NNTF}
924 \begin{codesyntax}%
925 \tsmacro{\starray_uparsed_get_unique_id:NN}{parsed-refA,tl-var}
926 \tsmacro{\starray_uparsed_get_unique_id:NNTF}{parsed-refA,tl-var,if-true,if-false}
927 \end{codesyntax}
928 Gets an `unique ID' from the last parsed term. The \tsobj{\starray_uparsed_get_unique_id:NNTF} is for symmetry only (with other commands), it will always execute the \tsobj[marg]{if-true}.
929 \end{codedescribe}
930 \begin{tsremark}[\color{red}Warning:]
931 \tsobj[marg]{parsed-refA} should be the value returned by \tsobj{\starray_term_parser:nN}.
932 \end{tsremark}
933
934 \subsubsection{Deprecation Equivalence List}
935 Bellow follows a complete list of all deprecated names and their corresponding new names. Note each command signature (one N shorter).
936 \begin{describelist*}[60mm]{code}
937 \describe{Deprecated}{\tsobj{New}}
938 \describe{\starray_term_parser:nNN} {\tsobj{\starray_term_parser:nN}}
939 \describe{\starray_term_parser:nNNTF} {\tsobj{\starray_term_parser:nNTF}}
940 \describe{\starray_parsed_if_in_p:NNn} {\tsobj{\starray_uparsed_if_in_p:Nn}}
941 \describe{\starray_parsed_if_in:NNnTF} {\tsobj{\starray_uparsed_if_in:NnTF}}
942 \describe{\starray_parsed_get_iter:NN} {\tsobj{\starray_uparsed_get_iter:N}}
943 \describe{\starray_parsed_get_iter:NNN} {\tsobj{\starray_uparsed_get_iter:NN}}
944 \describe{\starray_parsed_get_iter:NNNTF} {\tsobj{\starray_uparsed_get_iter:NNTF}}
945 \describe{\starray_parsed_get_cnt:NN} {\tsobj{\starray_uparsed_get_cnt:N}}
946 \describe{\starray_parsed_get_cnt:NNN} {\tsobj{\starray_uparsed_get_cnt:NN}}
947 \describe{\starray_parsed_get_cnt:NNNTF} {\tsobj{\starray_uparsed_get_cnt:NNTF}}
948 \describe{\starray_parsed_get_prop:NNn} {\tsobj{\starray_uparsed_get_prop:Nn}}
949 \describe{\starray_parsed_get_prop:NNnN} {\tsobj{\starray_uparsed_get_prop:NnN}}
950 \describe{\starray_parsed_get_prop:NNnNTF} {\tsobj{\starray_uparsed_get_prop:NnNTF}}
951 \describe{\starray_parsed_get_unique_id:NNN} {\tsobj{\starray_uparsed_get_unique_id:NN}}
952 \describe{\starray_parsed_get_unique_id:NNNTF} {\tsobj{\starray_uparsed_get_unique_id:NNTF}}
953 \end{describelist*}
954
955
956 \subsection{Parsed Commands on Iterate Over}\label{parsed:iter-over}
957 When iterating over a \tsobj[marg]{starray-ref}, see \ref{iterate-over}, internal variables are set pointing the current (iterated over) starray term: This removes the need, for instance, to execute \tsobj{\starray_term_parser:n} before using some `parsed' commands (previous sections). The following commands can be used in combination with the ones from \ref{parsed:internal} and \ref{parsed:user-var}.
958
959 Observe that, in case of nested \tsobj{\starray_iterate_over:nn}, the \tsobj{_iparsed_} commands always refer to the immediate \tsobj{\starray_iterate_over:nn}, meaning that, in `case A' below, \tsobj[key]{key-Aa} is a key of the starray \tsobj[marg]{st-A} (\tsobj[marg]{st-A[iter st-A]}), whilst (case B), \tsobj[key]{key-Xa} is a key of the starray \tsobj[marg]{st-A.sub-X} (better said: \tsobj[marg]{st-A[iter st-A].sub-X[iter sub-X]}
960
961 \begin{codestore}[nested-iter]
962 \starray_iterate_over:nn {st-A}
963 {
964 ... \starray_iparsed_get_prop:n {key-Aa} %% case A
965
966 \starray_iterate_over:NN {st-A.sub-X}
967 {
968 ... \starray_iparsed_get_prop:n {key-Xa} %% case B
969 }
970 }
971 \end{codestore}
972 \tscode*[starray]{nested-iter}
973
974 \begin{codedescribe}[code,EXP,new=2026/02/01]{\starray_iparsed_if_in_p:n,\starray_iparsed_if_in:nTF}
975 \begin{codesyntax}%
976 \tsmacro{\starray_iparsed_if_in_p:nTF}{key}
977 \tsmacro{\starray_iparsed_if_in:nTF}{key,if-true,if-false}
978 \end{codesyntax}
979 This will test if the given \tsobj[key]{key} is present in the current, iterated over, term.
980 \end{codedescribe}
981 \begin{tsremark}
982 The predicate version, \tsobj{_p}, expands to either \tsobj{\c_true_bool} or \break \tsobj{\c_false_bool}.
983 \end{tsremark}
984 \begin{tsremark}[\color{red}Warning:]
985 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
986 \end{tsremark}
987
988
989 \begin{codedescribe}[code,EXP,new=2026/02/01]{\starray_iparsed_get_iter:}
990 \begin{codesyntax}%
991 \tsobj{\starray_iparsed_get_iter:}{}
992 \end{codesyntax}
993 \tsobj{\starray_iparsed_get_iter:} will place in the current iterator's value, using \tsobj{\int_use:N}, of the current, iterated over, term in the input stream.
994 \end{codedescribe}
995 \begin{tsremark}[\color{red}Warning:]
996 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
997 \end{tsremark}
998
999 \begin{codedescribe}[code,new=2026/02/01]{\starray_iparsed_get_iter:N,\starray_iparsed_get_iter:NTF}
1000 \begin{codesyntax}%
1001 \tsmacro{\starray_iparsed_get_iter:N}{int-var}
1002 \tsmacro{\starray_iparsed_get_iter:NTF}{int-var,if-true,if-false}
1003 \end{codesyntax}
1004 These will save the iterator’s value (of a parsed term) in a integer variable (\tsobj[pkg]{expl3}\cite{expl3}). The \tsobj[marg]{if-true,if-false} regards the status of the last \tsobj{\starray_term_parser:} command, iff the option \tsobj[option]{parsed check} (see \ref{pack:options}) is enable, otherwise it will always execute the \tsobj[marg]{if-true} branch.
1005 \end{codedescribe}
1006 \begin{tsremark}[\color{red}Warning:]
1007 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
1008 \end{tsremark}
1009
1010 \begin{codedescribe}[code,EXP,new=2026/02/01]{\starray_iparsed_get_cnt:}
1011 \begin{codesyntax}%
1012 \tsobj{\starray_iparsed_get_cnt:}{}
1013 \end{codesyntax}
1014 \tsobj{\starray_iparsed_get_cnt:} will place the current number of terms, using \tsobj{\int_use:N}, of the current, iterated over, term, in the input stream.
1015 \end{codedescribe}
1016 \begin{tsremark}[\color{red}Warning:]
1017 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
1018 \end{tsremark}
1019
1020 \begin{codedescribe}[code,new=2026/02/01]{\starray_iparsed_get_cnt:N,\starray_iparsed_get_cnt:NTF}
1021 \begin{codesyntax}%
1022 \tsmacro{\starray_get_cnt:N}{integer}
1023 \tsmacro{\starray_get_cnt:NTF}{integer,if-true,if-false}
1024 \end{codesyntax}
1025 Similarly to \tsobj{\starray_get_cnt:nN,\starray_get_cnt:nNTF} these will save the number of terms (of the current, iterated over, term) in a integer variable (\tsobj[pkg]{expl3}\cite{expl3}). The \tsobj[marg]{if-true,if-false} regards the status of the last \tsobj{\starray_term_parser:} command, iff the option \tsobj[option]{parsed check} (see \ref{pack:options}) is enable, otherwise it will always execute the \tsobj[marg]{if-true} branch.
1026 \end{codedescribe}
1027 \begin{tsremark}[\color{red}Warning:]
1028 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
1029 \end{tsremark}
1030
1031
1032
1033
1034 \begin{codedescribe}[code,EXP,new=2026/02/01]{\starray_iparsed_get_prop:n}
1035 \begin{codesyntax}%
1036 \tsmacro{\starray_iparsed_get_prop:n}{key}
1037 \end{codesyntax}
1038 \tsmacro{\starray_iparsed_get_prop:n}{key} places the value of \tsobj[marg]{key}, if it exists, from the current, iterated over, term, in the input stream.
1039 \end{codedescribe}
1040 \begin{tsremark}[\color{red}Warning:]
1041 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
1042 \end{tsremark}
1043
1044 \begin{codedescribe}[code,new=2026/02/01]{\starray_iparsed_get_prop:nN,\starray_iparsed_get_prop:nNTF}
1045 \begin{codesyntax}%
1046 \tsmacro{\starray_iparsed_get_prop:nN}{key,tl-var}
1047 \tsmacro{\starray_iparsed_get_prop:nNTF}{key,tl-var,if-true,if-false}
1048 \end{codesyntax}
1049 \tsmacro{\starray_iparsed_get_prop:nN}{key,tl-val} stores the value of \tsobj[marg]{key}, if it exists, from the current, iterated over, term. The \tsobj[marg]{if-false} branch is executed if \tsobj[marg]{key} doesn't exist or (if the option \tsobj[option]{parsed check}, see \ref{pack:options}, is enabled) if the last parser operation has failed.
1050 \end{codedescribe}
1051 \begin{tsremark}[\color{red}Warning:]
1052 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
1053 \end{tsremark}
1054
1055 \begin{codedescribe}[code,new=2026/02/01]{\starray_iparsed_get_unique_id:nN,\starray_iparsed_get_unique_id:nNTF}
1056 \begin{codesyntax}%
1057 \tsmacro{\starray_iparsed_get_unique_id:nN}{tl-var}
1058 \tsmacro{\starray_iparsed_get_unique_id:nNTF}{tl-var,if-true,if-false}
1059 \end{codesyntax}
1060 Gets an `unique ID' from the current, iterated over, term. The \tsobj[marg]{if-true,if-false} regards the status of the last \tsobj{\starray_term_parser:} command, iff the option \tsobj[option]{parsed check} (see \ref{pack:options}) is enable, otherwise it will always execute the \tsobj[marg]{if-true} branch.
1061 \end{codedescribe}
1062 \begin{tsremark}[\color{red}Warning:]
1063 This should only be used in the \tsobj[marg]{code} part of \tsobj[code,or]{\starray_iterate_over:nn,\starray_iterate_over:nnTF}.
1064 \end{tsremark}
1065
1066
1067
1068 \section{Showing (debugging) starrays }\label{pack:show}
1069
1070 \begin{codedescribe}{\starray_show_def:n,\starray_show_def_in_text:n}
1071 \begin{codesyntax}%
1072 \tsmacro{\starray_show_def:n}{starray-ref}
1073 \tsmacro{\starray_show_def_in_text:n}{starray-ref}
1074 \end{codesyntax}
1075 Displays the \tsobj[marg]{starray} structure definition and initial property values in the terminal or directly in text.
1076 \end{codedescribe}
1077 \begin{tsremark}
1078 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error or invalid \tsobj[meta]{hash}.
1079 \end{tsremark}
1080
1081
1082 \begin{codedescribe}{\starray_show_terms:n,\starray_show_terms_in_text:n}
1083 \begin{codesyntax}%
1084 \tsmacro{\starray_show_terms:n}{starray-ref}
1085 \tsmacro{\starray_show_terms_in_text:n}{starray-ref}
1086 \end{codesyntax}
1087 Displays the \tsobj[marg]{starray} instantiated terms and current property values in the terminal or directly in text.
1088 \end{codedescribe}
1089 \begin{tsremark}
1090 A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error or invalid \tsobj[meta]{hash}.
1091 \end{tsremark}
1092
1093 %% if needed
1094 \printbibliography
1095
1096
1097 \end{document}