I am seeing different behavior of coerce between different versions of Common Lisp - wondering which one is "right" or is the standard ambiguous on this seemingly simple question:
is
(coerce '(1 2 3) 'array)
correct lisp? It works fine in Clozure Common Lisp but not in sbcl.
And when it does not work what is the easiest way to coerce a list into an array?
Thanks
The specification says:
arrayis not a subtype ofvector-- vectors are 1-dimensional arrays, butarrayincludes arrays with any number of dimensions.You can use one of these
In the second version,
(*)specifies a single dimension whose size is unspecified.Your use is unspecified, so implementations are free to implement it as they please. If it returns a value, the value has to be an
ARRAYof some kind.