anchor.diff:       ,@body))
   
   (defmethod to-string ((iter iterator))
  -  (with-slots (start end increment id quiet initial-contents cyclic) iter
  -    (format T "start: ~A, end: ~A, quiet: ~A, inc: ~A, cyclic: ~A, initial-contents: ~A ~%"
  -            start end quiet increment cyclic initial-contents)))
  +  (with-slots (start end increment id quiet contents cyclic) iter
  +    (format nil "start: ~A, end: ~A, quiet: ~A, inc: ~A, cyclic: ~A, initial-contents: ~A ~%"
  +            start end quiet increment cyclic contents)))
   
   (defun get-sequence-iter-varlist (all-clauses)
     (list
  
positive.code:            :take-until
             :zip
             :reset
             :make-iterator
             :with-iterator
             :do-sequence-iterator
  
negative.code:            :do-sequence-iterators*
             :dosequences*
             :dosequence
             :list-to-alist
             :to-string))
  
  (in-package :cl-iterators)
  
  (defvar *limit* most-positive-fixnum
    "Serves as the end of the iterator in case where it isn't specified.")
  
  (define-condition stop-iteration-exception()
    ((text :initarg :text
           :reader text)))
  
  (defclass iterator()
    ((start :initform 0
            :initarg :start
            :accessor start
            :documentation "The start of the iteration, either an index value or integer value to mark the start of iteration")
     (index :initform 0
            :accessor index
            :documentation "the current index of the iteration") 
     (end :initform *limit*
          :initarg :end
          :accessor end
          :documentation "The end of the iteration, *limit* denotes an infinite iteration, for lists/sequences, the sequence length limits the iteration")
     (increment :initform 1
                :initarg :inc
                :accessor increment
                :documentation "the increment of the iteration")
     (id :initform #'identity
         :initarg :id
         :accessor id
         :documentation "Applied over each value before returning to the caller.")
     (quiet :initform nil
            :initarg :quiet
            :accessor quiet-p
            :documentation "Whether to raise an error when iterations are exhausted")
     (contents :initform nil
               :initarg :initial-contents
               :accessor initial-contents
               :documentation "A list/sequence of initial-contents to be iterated")
     (element :initform nil
              :initarg :initial-element
              :accessor initial-element
              :documentation "When supplied and no initial-contents supplied, iteration returns the value instead of the index")
     (cyclic :initform nil
             :initarg :cyclic
             :accessor cyclic-p
             :documentation "Whether the iteration is cyclic, in case where initial-contents are supplied the sequence re-iterated otherwise the iteration resets the index to start")
     (check :initform #'<=
            :accessor bound-check
            :documentation "Function to check the boundaries of the iterator.")
     (from-end :initarg :from-end
               :accessor from-end-p
               :documentation "When T, direction of iteration is reversed.")
     (accessor :initform #'elt
               :accessor accessor
               :documentation "Function to access to individual members of a initial-contents, #'nth for lists, #'elt for others")))
  
  (defmethod reset ((iter iterator))
    (with-accessors ((start start) (index index)) iter
      (setf index start)))
  
  (defmethod valid-p ((iter iterator))
    (with-accessors ((index index)
                     (check bound-check)
                     (end end)) iter
      (or (eq end *limit*) (funcall check index end))))
  
  (defmethod next ((iter iterator))
    (with-accessors ((index index)
                     (element initial-element)
                     (contents initial-contents)) iter
      (cond
        ((valid-p iter)
         (let ((current
                (funcall (id iter)
                         (cond
                           ((not (null contents))
                            (funcall (accessor iter) contents index))
                           ((not (null element)) element)
                           (T index)))))
           (incf index (increment iter))
           current))
        ((cyclic-p iter) (progn
                           (reset iter)
                           (next iter)))
        ((not (quiet-p iter))
         (error 'stop-iteration-exception
                :text (to-string iter))))))
  
  (defmethod take (n (iter iterator))
    (let ((has-ended nil))
      (loop for i from 1 to n
         for value = (handler-case
                         (next iter)
                       (stop-iteration-exception ()
                         (setf has-ended T)))
         while (not has-ended)
         collect value)))
  
  (defmethod take-while (pred (iter iterator))
    (let ((has-ended nil))
      (loop for value = (handler-case
                            (next iter)
                          (stop-iteration-exception ()
                            (setf has-ended T)))
         while (and (not has-ended)
                    (funcall pred value))
         collect value)))
  
  (defmethod zip ((a iterator) (b iterator))
    (let ((has-ended nil))
      (loop
         for value-a = (handler-case
                           (next a)
                         (stop-iteration-exception ()
                           (setf has-ended T)))
         for value-b = (handler-case
                           (next b)
                         (stop-iteration-exception ()
                           (setf has-ended T)))
         while (not has-ended)
         collect (cons value-a value-b))))
  
  (defmacro make-iterator (&key (start 0) (end *limit*) (inc 1)
                             (id #'identity) (cyclic nil) (from-end nil)
                             (initial-contents ()) (initial-element nil))
    (let ((iter (gensym "iterator")))
      `(let ((,iter
              (make-instance 'iterator :start (or ,start 0)
                             :end (let ((len (1- (length ,initial-contents)))
                                        (end (or ,end *limit*)))
                                    (or (when (not (null ,initial-contents))
                                          (if (= end *limit*)
                                              len
                                              (when (> end len)
                                                (error "length out of bounds"))))
                                        end))
                             :inc ,inc :id ,id :cyclic ,cyclic
                             :initial-contents ,initial-contents
                             :initial-element ,initial-element)))
         (with-slots (start end index contents
                            increment accessor check) ,iter
           (when (listp contents)
             (setf accessor #'(lambda(seq n) (nth n seq))))
           (if ,from-end
               (progn
                 (rotatef start end)
                 (setf index start
                       check #'>=
                       increment (* -1 ,inc)))
               (setf index start)))
         ,iter)))
  