[Ecls-list] An array becomes a list ?
marcoxa at cs.nyu.edu
Wed Jan 18 07:10:06 UTC 2006
David Creelman wrote:
> On Tue, 2006-01-17 at 10:50 -0500, Marco Antoniotti wrote:
>>On Jan 16, 2006, at 9:55 PM, David Creelman wrote:
>>>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 :) )
> Hmmm, it does parse, so I'm not sure what the error is.
Check the argument list for MAKE-ARRAY.
Also I'm not
> sure what the misfeature is. I'd be interested if you could point them
Like it or not, the standard settings for CL uppercase your symbols.
Therefore, unless you have taken steps to ensurte that the symbol name
of the string bit *SendBuffer* has its case preserved, you will end up
with *SENDBUFFER*. In other words, StUdLycAps are not-so-kosher style
in CL. But this is just nitpicking.
>>Consider the string
>> "(I am a cons)"
>> type_of(c_string_to_object("(I am a cons)")
> I think this would return a cons. If you ran it, you'd get an error
> unless you've defuned a function "I".
Yes. But, AFAIU the code snippet is not running it.
>>Also, what about
> I think this would be t_fixnum ?
More information about the ecl-devel