def set_nth(list, n, value)
      assert_type n, :Number, :n
      Sass::Script::Value::List.assert_valid_index(list, n)
      index = n.to_i > 0 ? n.to_i - 1 : n.to_i
      new_list = list.to_a.dup
      new_list[index] = value
      list.with_contents(new_list)
    end
def set_nth(list, n, value)
      assert_type n, :Number, :n
      Sass::Script::Value::List.assert_valid_index(list, n)
      index = n.to_i > 0 ? n.to_i - 1 : n.to_i
      new_list = list.to_a.dup
      new_list[index] = value
      list.with_contents(new_list)
    end
Return a new list, based on the list provided, but with the nth
 element changed to the value given.

 Note that unlike some languages, the first item in a Sass list is number
 1, the second number 2, and so forth.

 Negative index values address elements in reverse order, starting with the last element
 in the list.

 @example
   set-nth($list: 10px 20px 30px, $n: 2, $value: -20px) => 10px -20px 30px
 @overload set-nth($list, $n, $value)
   @param $list [Sass::Script::Value::Base] The list that will be copied, having the element
     at index `$n` changed.
   @param $n [Sass::Script::Value::Number] The index of the item to set.
     Negative indices count from the end of the list.
   @param $value [Sass::Script::Value::Base] The new value at index `$n`.
 @return [Sass::Script::Value::List]
 @raise [ArgumentError] if `$n` isn't an integer between 1 and the length
   of `$list`