def shift( *offset )
      if offset.size != dimension
        raise "#{offset.size} offset(s) were given but array has " +
              "#{dimension} dimension(s)"
      end
      retval = Hornetseye::MultiArray(typecode, dimension).new *shape
      target, source, open, close = [], [], [], []
      ( shape.size - 1 ).step( 0, -1 ) do |i|
        callcc do |pass|
          delta = offset[i] % shape[i]
          source[i] = 0 ... shape[i] - delta
          target[i] = delta ... shape[i]
          callcc do |c|
            open[i] = c
            pass.call
          end
          source[i] = shape[i] - delta ... shape[i]
          target[i] = 0 ... delta
          callcc do |c|
            open[i] = c
            pass.call
          end
          close[i].call
        end
      end
      retval[ *target ] = self[ *source ] unless target.any? { |t| t.size == 0 }
      for i in 0 ... shape.size
        callcc do |c|
          close[i] = c
          open[i].call
        end
      end
      retval
    end
def shift( *offset )
      if offset.size != dimension
        raise "#{offset.size} offset(s) were given but array has " +
              "#{dimension} dimension(s)"
      end
      retval = Hornetseye::MultiArray(typecode, dimension).new *shape
      target, source, open, close = [], [], [], []
      ( shape.size - 1 ).step( 0, -1 ) do |i|
        callcc do |pass|
          delta = offset[i] % shape[i]
          source[i] = 0 ... shape[i] - delta
          target[i] = delta ... shape[i]
          callcc do |c|
            open[i] = c
            pass.call
          end
          source[i] = shape[i] - delta ... shape[i]
          target[i] = 0 ... delta
          callcc do |c|
            open[i] = c
            pass.call
          end
          close[i].call
        end
      end
      retval[ *target ] = self[ *source ] unless target.any? { |t| t.size == 0 }
      for i in 0 ... shape.size
        callcc do |c|
          close[i] = c
          open[i].call
        end
      end
      retval
    end
Create array with shifted elements

 @param [Array<Integer>] offset Array with amount of shift for each dimension.

 @return [Node] The result of the shifting operation.