Description
Require a nonempty values list, normalize signed index modulo its length, and return that item and its cyclic successor.
Token lists preserve element boundaries that raw character matching can lose. Prefix-suffix overlap and separator placement depend on exact element and empty-list conventions.
Require a nonempty values list, normalize signed index modulo its length, and return that item and its cyclic successor.
When to use this tool
Use Cyclic List Neighbor Pair when you need a token-boundary overlap or separator-count calculation.
How to use the tool and how it works
- Enter values, index. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read current, next. Use the output convention below.
Require a nonempty values list, normalize signed index modulo its length, and return that item and its cyclic successor.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| values | Values | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| index | Zero-based position or diagnostic index under the calculation above; inspect any sentinel policy. | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| current | Current | Required. Text; maximum UTF-16 length 8192. |
| next | Next | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"values": [
"A",
"B",
"C"
],
"index": 2
},
"output": {
"current": "C",
"next": "A"
}
} Limitations and assumptions
- A singleton returns the same value twice; no list mutation or neighbor search is performed.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Choose token normalization and escaping rules before joining or merging the actual list contents.
References
Similar or alternative tools
- List Cycle One Step Predecessor
Subtract one from a valid index and reduce modulo positive length for predecessor.
- List Neighbor Gap Cyclic Endpoint
Return period minus the last position plus the first for wrapGap.