[Ecls-list] Return values sometimes missing on REPL
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Thu Jun 3 14:10:32 UTC 2010
On Tue, Jun 1, 2010 at 2:23 PM, Erik Winkels <aerique at xs4all.nl> wrote:
> I'm starting a REPL by doing this in C++:
> cl_object obj = ecl_read_from_cstring("si:top-level");
> cl_funcall(1, obj);
> Now when calling functions that have been created with ecl_def_c_function
> I almost never get the return value back at the REPL, but they are set
> when I call the same function with setf or defparameter. Like so:
> OGRE> (get-actual-height *viewport*)
This toplevel does not seem to be the standard toplevel, for you have a
different prompt, to begin with. Then, you are not showing the code of the
functions you define and how they return multiple values. Most likely you
are just using a "return only-value" statement and do not set the counter
for the returned values, which is needed by ECL to know the number of
returned values. If you look at toplevel.c, the compiled version of the
toplevel you will see
/* EVAL-WITH-ENV */;
this evaluates the form stored in the variable '-, saving the first value in
the multiple values register and then copying the rest of values.
It would make REPL life a little easier if all of them returned values
> at the REPL. Any ideas?
More information. An ordinary REPL works just fine as shown in daily life.
Obviously there is some problem with either the functions you define (not
because of the way you defined them), or in the interface to those
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ecl-devel