Skip to content

Main content

List Single Gap Padding Policy Tool

Calculate list single gap padding policy from explicit caller-supplied inputs.

Loading tool…

Description

Copy values, append fill until index is reachable, and assign value at index.

A splice replaces part of a list and changes later positions. Cursor affinity defines which side of inserted content a boundary follows when the splice covers it.

Copy values, append fill until index is reachable, and assign value at index.

When to use this tool

Use List Single Gap Padding Policy when you need a splice length, gap-fill, or cursor-mapping calculation.

How to use the tool and how it works

  1. Enter values, index, value, fill. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read values, padding. Use the output convention below.

Copy values, append fill until index is reachable, and assign value at index. Return the number of inserted gap-fill positions.1

Input fieldMeaning and unitsAccepted input
valuesValuesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
indexIndexRequired. Safe integer; minimum 0; maximum 255.
valueValueRequired. Text; maximum UTF-16 length 8192.
fillFillRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
valuesValuesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
paddingUnused or added positions under the stated alignment rule.Required. Safe integer.
json
{
  "input": {
    "values": [
      "a"
    ],
    "index": 3,
    "value": "z",
    "fill": "_"
  },
  "output": {
    "values": [
      "a",
      "_",
      "_",
      "z"
    ],
    "padding": 2
  }
}

Limitations and assumptions

  • Index is limited to 255; assigning inside the original list replaces an item and assigning at its end appends without gap padding.
  • 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

Check the actual collection API's deletion clamping and cursor semantics before applying an edit.

References

  1. Calculation and input contract: list/list-single-gap-padding-policy — tool.io

Similar or alternative tools