{
"id": "fn-array-range",
"dataComponent": "array",
"heading": {
"title": "range",
"badges": ["Array", "PARTIAL"]
},
"synopsis": "Produces an IntArray of consecutive integers from start (inclusive) up to end (exclusive). Partial usage is supported for start/end arguments.",
"codeBlocks": [
"extend(\"array\")\\n\\n// array:range(0, 5) => [0,1,2,3,4]\\nsput( array:range(0, 5) )\\n// => [0,1,2,3,4]\\n\\n// If start >= end => returns an empty array\\n\\n// Partial usage => only provide start\\nrangeFrom2 = array:range(2)\\nsput( rangeFrom2(6) )\\n// => [2,3,4,5]\\n\\n// Placeholders => array:range(_, 5), etc."
],
"notes": [
"Accepts two integer arguments: start, end. Generates an array of integers [start..end).",
"If only one is provided, it returns a partial function expecting the other. If both are missing or `_`, partial usage continues until both are known.",
"Negative or reversed ranges result in an empty array. This is akin to many functional libraries’ range semantics."
]
}