(defun flatten (array) (make-array (array-total-size array) :displaced-to array)) (defun test () (let ((a (make-array '(2 2) :initial-contents '((1 2) (3 4))))) (flatten a))) ;; CL-USER> (load "/home/death/tmp/foo.lisp") ;; T ;; CL-USER> (test) ;; #(1 2 3 4) ;; CL-USER> (load (compile-file "/home/death/tmp/foo.lisp")) ;; ; compiling file "/home/death/tmp/foo.lisp" (written 05 MAR 2024 01:57:09 PM): ;; ;; ; wrote /home/death/tmp/foo.fasl ;; ; compilation finished in 0:00:00.010 ;; T ;; CL-USER> (test) ;; ; Evaluation aborted on #>.