[Ecls-list] An array becomes a list ?

Marco Antoniotti marcoxa at cs.nyu.edu
Tue Jan 17 07:51:05 UTC 2006


On Jan 16, 2006, at 9:55 PM, David Creelman wrote:

> Hi List,
>
> cl_object SendBuffer = c_string_to_object("(defvar *SendBuffer*
> (make-array 6 0))");
> cl_type check = type_of(SendBuffer);
>
> The above code gives back t_cons, not t_vector. Is there some way I can
> force it to be an array so I can use aref directly from C ?


Well, the code does exactly what you tell it to do.

	"(defvar *sendbuffer* (make-array 6 0))"

is a string that contains a CONS (hence a t_cons; and BTW, you have one 
misfeature in your code and a error :) )

Consider the string

	"(I am a cons)"

What should

	type_of(c_string_to_object("(I am a cons)")

return?  Also, what about

	type_of(c_string_to_object("42"))

?

Cheers
--
Marco
--
Marco Antoniotti					http://bioinformatics.nyu.edu/~marcoxa
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.





More information about the ecl-devel mailing list