# set-nth Return a new list with the element at an index replaced. ## Syntax
[set-nth $list $n $val]
`$n` is zero-based; negative counts from the end. ## Examples
[set-nth @{ 1 2 3 } 0 9]     # @{ 9 2 3 }
[set-nth @{ 1 2 3 } -1 9]    # @{ 1 2 9 }
[set-nth @{ 1 2 3 } 9 9]     # @{ 1 2 3 }  (out of range, unchanged)
## Returns New list with the element at `$n` replaced. Returns the original list if `$n` is out of range. ## See Also `nth`, `insert-nth`, `remove-nth`, `append`