You can use a helper function:
(def make-list (size val) (make-list-helper nil size val)) (def make-list-helper (alist size val) (if (is size 1) (cons val alist) (make-list-helper (cons val alist) (- size 1) val)))
(def make-list (size val) (let helper (afn (alist size val) (if (is size 1) (cons val alist) (self (cons val alist) (- size 1) val))) (helper nil size val)))