From adbf67abf3b6d076502060e3f4c96e960ae86452 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 9 Jan 2018 13:30:49 -0500 Subject: [PATCH] state: Add _for-each-state_ and state-all * states.xml (_for-each-state_): Add template. (NVEC_STATE_ALL): Add vector. (state-all): Add class. --- core/states.xml | 106 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/core/states.xml b/core/states.xml index 1d1e7f0e..1ee1f241 100644 --- a/core/states.xml +++ b/core/states.xml @@ -1,6 +1,6 @@ + + +
The type \ref{State} contains each of the States in the United~States, @@ -87,4 +91,104 @@
+ + + +
+ For operations that involve taking values of all states where order + matters (e.g. for index alignment), + querying the symbol table isn't appropriate, + as it does not guarantee order. + \ref{_for-each-state_} can be used for that purpose; + it exposes the following template values to its body: + + \begin{enumerate} + \item \tt{@state_const@} contains the State constant; + \item \tt{@state_upper@} contains the uppercase two-letter State + abbreviation; + \item \tt{@state_lower@} contains the lowercase two-letter State + abbreviation; and + \item \tt{@state_name@} contains the full state name. + \end{enumerate} + + This can be used to generate a ^[State vector] by mapping an iteration + index to the State constant~\tt{@state_const@}. + Note that \ref{STATE_NONE} is not in the list. + + + + + To ease iteration though ^[State vector]s generated with + \ref{_for-each-state_}, + a 52~vector \ref{NVEC_STATE_ALL} and classification \ref{state-all} + are provided. + + + + + + +