docs: def weld_slice(array, weld_type, slice_, default_start=0, default_stop=0, default_step=1):
      """Returns a new array according to the given slice.
  
      Parameters
      ----------
      array : numpy.ndarray or WeldObject
          1-dimensional array.
      weld_type : WeldType
          Type of the elements in the input array.
      slice_ : slice
          Subset to return. Assumed valid slice.
      default_start : int, optional
          Default value to slice start.
      default_stop : int, optional
          Default value to slice stop.
      default_step : int, optional
          Default value to slice step.
  
      Returns
      -------
      WeldObject
          Representation of this computation.
  
      """
      from ..core.utils import replace_slice_defaults
  
      slice_ = replace_slice_defaults(slice_, default_start, default_stop, default_step)
      obj_id, weld_obj = create_weld_object(array)
  
      if slice_.step == 1:
          weld_template = """slice(
      {array},
      {slice_start},
      {slice_stop}
  )"""
      else:
          weld_template = """result(
      for(
          iter({array}, {slice_start}, {slice_stop}, {slice_step}),
          appender[{type}],
          |b: appender[{type}], i: i64, e: {type}| 
              merge(b, n)
      )  
  )"""
  
      weld_obj.weld_code = weld_template.format(array=obj_id,
                                                type=weld_type,
                                                slice_start='{}L'.format(slice_.start),
                                                slice_stop='{}L'.format(slice_.stop - slice_.start),
                                                slice_step='{}L'.format(slice_.step))
  
      return weld_obj