Function: ARRAY-SHIFT-LEFT

Documentation

- shifts all elements between start and end to the left - leftmost element (at :start) is removed from array - inserts a new value at end

Source

(defun array-shift-left (array &key (start 0) (end (1- (length array)))
			 (replace nil))
  "- shifts all elements between start and end to the left
   - leftmost element (at :start) is removed from array
   - inserts a new value at end"
  (loop for i from (1+ start) to end
	for j from start
	do (setf (aref array j)
		 (aref array i))
	finally (progn (setf (aref array end) replace)
		       (return array))))
Source Context