make_array



Leo Butler a ?crit :
> Is the documentation incorrect here, or this bug in make_array, or
> between my ears? The other array types work as described.
>
> Leo
> ----
>
> (%i5) ? make_array
>
>   -- Function: make_array (<type>, <dim_1>, ..., <dim_n>)
>       Creates and returns a Lisp array.  <type> may be `any', `flonum',
>       `fixnum', `hashed' or `functional'.  There are n indices, and the
>       i'th index runs from 0 to <dim_i> - 1.
>
> (%i6) y : make_array('functional,4);
>
> make_array: not enough arguments for functional array specification.
>   -- an error.  To debug this try debugmode(true);
>
>   
Hello,

I have no reply to your question, but related comments.

Just for information, the file ar.lisp (that I don't understand) 
implementing make_array contains a comment saying :
"    ;; Is FUNCTIONAL here an error?"
So there might be a known bug.

I think the documentation could also be more explicit about other options :

- what are these options intended for ? The only difference between 
fixnum and flonum seems to be in the initialization (0 versus 0.0), but 
it seems possible to assing a float value to a fixnum array : is it 
right ? is it the same with the "any" option ?

- How do we use a hashed array ? this gives two different errors :
h:make_array(hashed,4);   h[blue]:color;   h[20]:3;
So what is "hashed" done for ?


Finally, make_array is not very robust since this seems to enter and 
endless loop instead of printing an error (or truncating the dimension) :
stupid : make_array(fixnum,4.5);

Eric Reyssat