[Ecls-list] Simple Hello word! function

Pascal J. Bourguignon pjb at informatimago.com
Sun Jul 4 16:56:47 UTC 2010


Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> writes:

> The problem with your code ...
>
> cl_object ecl_eval(char* code) {
> cl_object obj = c_string_to_object(code);
> return si_safe_eval(3, obj, Cnil, g_evalErrorSymbol);
> }
>
> is that it relies on c_string_to_object() which will only read the FIRST object it finds in the string, ignoring
> the remaining part of the string. One quick hack would be to surround the string with parenthesis and the
> evaluating the forms in the resulting list, one after another.

Well the quick hack would be to surround it in a "(progn "  ... ")".

But then you would break reader macros:

 "(install-my-macro-char) {do something funny}"

;-)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/





More information about the ecl-devel mailing list