;build-list si muzete naprogramovat obdobne, jako ve Scheme (jenom se misto letrec pouzije labels…)
(defun build-list (len fun) (labels ((build-list-helper (i) (unless (= i len) (cons (funcall fun i) (build-list-helper (+ i 1)))))) (build-list-helper 0)))
;nebo pomoci dotimes a setf (probrane na prvni prednasce)
(defun build-list (len fun) (let (result) (dotimes (i len) (setf result (cons (funcall fun i) result))) (reverse result)))
;elegantnejsi reseni nabizi loop (neprobira se ale v kurzu):
(defun build-list (len fun) (loop for i from 0 below len collect (funcall fun i)))