Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define-setf-expander values-subseq (sequence start end &environment env)
- (check-type start integer)
- (check-type end integer)
- (multiple-value-bind (temps values newval setter getter)
- (get-setf-expansion sequence env)
- (declare (ignore setter newval))
- (let* ((stemp (gensym "SEQUENCE"))
- (size (- end start))
- (_ (check-type size (integer 1)))
- (vtemps (loop repeat size collect (gensym "ELEMENT"))))
- (declare (ignore _))
- (values (append temps (list stemp))
- (append values (list getter))
- vtemps
- `(values ,@(loop for vtemp in vtemps
- for i from start
- collect `(setf (elt ,stemp ,i) ,vtemp)))
- `(values ,@(loop for i from start below end
- collect `(elt ,stemp ,i)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement