[Ecls-list] cl_defparameter() question
Larry Clapp
larry at theclapp.org
Thu May 6 05:56:01 UTC 2004
Juan Jose Garcia Ripoll said:
> Michael O'Connor wrote:
>
>> c_string_to_object() works - thanks! However I
>> couldn't get cl_intern() to work, so this works:
>>
>> cl_defparameter(c_string_to_object("*test-var*"),
>> make_simple_string("test-value"));
>>
>> But this doesn't:
>>
>> cl_defparameter(cl_intern(1,
>> make_simple_string("*test-var*")),
>> make_simple_string("test-value"));
>>
>> I'd be curious to know why that is.
>>
> For the same reason it does not work under Common-Lisp: you have not told
> INTERN in which package it should put the symbol.
But that's an optional parameter. (INTERN "foo") works. Of course, you
get |foo|, not FOO as you probably wanted.
I bet it has more to do with the fact that c_string_to_object indirectly
calls read_object on the string, which capitalizes it.
I haven't tried it, but
cl_defparameter(cl_intern(1, make_simple_string("*TEST-VAR*")),
make_simple_string("test-value"));
might work.
-- Larry
More information about the ecl-devel
mailing list