(defun gen-string (&key (length (gen-integer :min 0 :max 80)) (elements (gen-character)) (element-type 'character)) (lambda () (loop with length = (funcall length) with string = (make-string length :element-type element-type) for index below length do (setf (aref string index) (funcall elements)) finally (return string))))Source Context