Description
Record each repeated index once in the order its repetition is first encountered.
An index map tracks where one item lands after a structural list operation. Zero-based element positions differ from boundary cursors, and missing destinations need a sentinel.
Record each repeated index once in the order its repetition is first encountered.
When to use this tool
Use List Gather Duplicate Index Flag when you need one item's position under an explicit list transformation.
How to use the tool and how it works
- Enter indices, sourceLength. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read duplicates, valid. Inspect valid before interpreting the associated values.
Record each repeated index once in the order its repetition is first encountered. Independently set valid when every index lies within sourceLength.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| indices | Indices | Required. Array of safe integer; maximum items 256. |
| sourceLength | Source Length | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| duplicates | Duplicates | Required. Array of safe integer; maximum items 256. |
| valid | Whether this narrowly scoped condition passes; it is not necessarily full-document validity. | Required. Boolean. |
{
"input": {
"indices": [
1,
2,
1,
1
],
"sourceLength": 3
},
"output": {
"duplicates": [
1
],
"valid": true
}
} Limitations and assumptions
- Duplicates can include invalid positions; a false valid flag does not prevent returning the duplicate list.
- 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
Apply the operation to a small representative list when checking a consuming language's indexing and slicing semantics.
References
Similar or alternative tools
- List Delete Selected Index Map
Return -1 and removed true for selected deletion; otherwise subtract the number of deletions before selected.
- List Bounded Prefix Equality Witness
Compare up to limit and both list lengths, recording the first mismatch.