cl:expand-list2   scheme


Defined in:  https://github.com/lambdamusic/extempore-extensions/blob/main/init/init_lisp.xtm

Implementation

;
;;;;;; new version 
;; add extra elements so that list has total len N
; (cl:expand-list2 50 3) ;; (50 50 50)
; (cl:expand-list2 '(50 30) 5) ;; (50 30 30 30 30)
(define cl:expand-list2 
   (lambda (l n)
      (if (list? l)
          (let ((xx (make-list (- n (length l)) (cl:last l))))
             (append l xx))
          (let ((xx (make-list n l)))
             xx))))


Back to Index