Subject: [clisp-list] multidimensional C-ARRAY: documentation differs from implementati on

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Tue Apr 29 01:22:04 2003

Hi,

there's a mismatch between implemented code and impnotes.
Impnotes uses (c-array c-type dim1 dim2 ... dimn)
The code implements (c-array c-type (dim1 dim2 ... dimn))
and (c-array c-type dim) as a shortcut for a one-dimensional array.

Back in 1996, before impnotes was converted to HTML, doc/foreign.txt already contained this mismatch: the BNF describing c-array, c-struct etc. defined
(c-array c-type (dim1 ... dimn)) and (c-array c-type dim1) -- as implemented -- while the explaining text talked about (c-array c-type dim1 ... dimn). The BNF was dropped during conversion to HTML.

(c-array c-type (dim1 ... dimn))
looks familiar to Lisp declarations (array elt-type (dim1 ... dimn))

However, (c-array c-type Number) means something completely different from
(array elt-type Number): the latter specifies an N-dimensional array.

The number-or-list polymorphism thus resembles MAKE-ARRAY, not Lisp array declarations.

If nobody says otherwise during a two weeks delay, I suggest to change the documentation to reflect the code, even though I'd prefer the (c-array c-type dim1 ... dimn) syntax that the description of c-array and ffi:element refer to and which naturally expands the (c-array c-type dim1) case. YMMV

http://clisp.cons.org/impnotes/dffi.html

Regards,
	Jörg Höhle.