Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type check dimension in make-array #372

Open
wants to merge 1 commit into
base: cl-compatible
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lisp/l/array.l
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
(setq entity (instantiate element-type dim))
(setq a entity)
(setq dim (list dim)))
(t
((consp dim)
(setq a (instantiate array))
(let* ((i 0)
(rank (length dim))
Expand All @@ -120,7 +120,8 @@
(setf (array-displaced-index-offset a) displaced-index-offset)
(do ((i 0 (1+ i)))
((>= i rank))
(setslot a array (+ i 5) (elt dim i))))))
(setslot a array (+ i 5) (elt dim i)))))
(t (error "integer or list expected")))
(when initial-element (fill entity initial-element))
(when initial-contents
(fill-initial-contents entity 0 dim initial-contents))
Expand Down