[Ecls-list] Changes towards 0.7b

Juan Jose Garcia-Ripoll jlr at mpq.mpg.de
Mon Nov 4 06:30:05 UTC 2002


back from San Francisco! The ILC lisp conference was a success. Lots of new 
ideas, and thanks to the jet lag, I was also able to work a lot on ECL :-)
So, here are the latest improvements. You can take it as an informal 
announcement of the 0.7b release. The final announcement will arrive in a few 
days, when I make sure that ECL builds on all machines in SourceForge. Then I 
will also make tar files with the sources.


*			IMPORTANT				    *

The names of many functions have changed. The global variables which
held pointers to symbols and keywords have disappeared. But the most
important change is the change on the calling conventions. Now there
are two types of C functions which the Lisp environment recognizes

1) Functions with a fixed number of arguments
	cl_object my_function(cl_object arg1, cl_object arg2)
They are passed to the lisp environment using cl_def_c_function()
and cl_make_cfun(). They take a fixed number of arguments and the
interpreter checks this for them

2) Functions with optional and keyword arguments
	cl_object my_function(int narg, ...)
They get a variable number of arguments, given by "narg". They should
check this and signal an error if needed. They are manipulated using
cl_def_c_function_va() and cl_make_cfun_va().

See below for a list of changes (And read src/h/external.h,
src/c/cfun.d, src/c/eval.d if you want :-)


* Errors fixed:

  - SI::BC-DISASSEMBLE would not use Lisp streams for output.

* System design:

  - Setting a (DECLARE (SI::C-LOCAL)) inside a function, we advise the
    compiler to make it local to an object file and do not export it
    for general use outside this file, neither as C code nor in Lisp.

  - New function cl_defvar() implements DEFVAR.

  - Global variable si::*cblock* keeps a pointer to the descriptor of the
    library being loaded (on systems which support DLLs).

* Visible changes:

  - The C counterparts of the Lisp functions have now the prefix
    cl_*. For instance, LIST-LENGTH is named cl_list_length(). There
    are two types of functions. Those who take a fixed number of
    arguments, are just called using C calling conventions:
	cl_object form = c_string_to_object("(1 2 3 4)");
	cl_object l = cl_list_length(form);
    But there are functions which take a variable number of arguments:
    in this case, the first argument must be the total number of
    arguments. For instance
	cl_object form = cl_read(0);
	cl_object form = cl_read(1, Cnil);

  - Renamed functions MF() and MM() to cl_def_c_function(),
    cl_def_c_function_va() and cl_def_c_macro_va(). Removed
    make_function() and make_si_function(), which had a more limited
    purpose. The *_va() functions take as argument a C function with
	cl_object (*function)(int narg, ...)
    which means that the function should accept any number of
    arguments and signal an error when the number is incorrect. The
    functions without *_va() suffix, take as argument a C function
    with prototype
	cl_object (*function)()
    and an integer "narg" denoting the number of arguments that this
    function actually receives.

  - Within the debugger, users are now able to evaluate expressions using the
    lexical environment of the functions being debugged. Sample session:
	> (defun foo (x) (cos x))
	> (foo 'a)
	A is not of type NUMBER.
	Broken at COS.
	>> :b
	Backtrace: COS > foo > eval
	>> :p
	Broken at FOO.
	>> :v
	Block names: FOO.
	Local variables: 
	  X: A
	>> X
	>> (return-from foo (cos 2.0))

  - DISASSEMBLE can now either disassemble the bytecodes of an interpreted
    function, or translate a lisp expression into C and show the result.

  - New program "ecl-config" outputs either the flags compile ("ecl-config
    -c") or to link ("ecl-config -l") a program using the ECL library.

  - In compiled code, constants which are EQUALP are merged; that is, they
    become EQ at run time.

  - cl_special_form_p() renamed to cl_special_operator_p().

* ANSI compatibility:

  - DEFINE-SYMBOL-MACRO finally implemented.

Max-Planck-Institut fuer Quantenoptik	+49/089/32905-127
Hans-Kopfermann-Str. 1, D-85748		www.arrakis.es/~worm
Garching b. Muenchen, Germany		worm at arrakis.es

More information about the ecl-devel mailing list