[Ecls-list] CMU format

Juan Jose Garcia-Ripoll worm at arrakis.es
Mon Dec 15 01:36:03 UTC 2003


On Thursday 11 December 2003 22:24, Julian St. wrote:
> Hello,
> after changing symbols_list.h as follows I was able to build ECL with
> the CMU format code (--with-cmuformat):
> But this version of format shows some strange behaviour:
> > (funcall (formatter "~@<~@:>") t)
> The function STREAM is undefined.
> Broken at LAMBDA.

A short answer: ECL does not have a pretty printer, and therefore the logical 
block statements do not work. I had not thought about it. I think I simply 
assumed that format.lsp did not rely on the pretty printer but implemented 
its own version of it. Bad news :-/ The idea of porting the pretty printer 
makes me a little bit sick, because, opposite to the AMOP or CLOS, where the 
specification itself can be directly translated into code, the pprinter is a 
very ugly and complicated piece of work. And CMUCL's relies on CMU streams, 
which complicates the port.

> I don't know what to make of the first error...

Sometimes the ECL runtime does not provide much information that one can use 
to debug problems. In this cases I recommend using the bootstrap version of 
ECL, called "ecl_min" and which you will find in the "ecls/build" directory. 
The following is a copy of the session in which I found out what the problem 
with FORMATTER was:

jlr at mpq3p32:~/src/ecls/build2> ./ecl_min
;*** Lisp core booted ****
ECLS (Embeddable Common Lisp)  16384 pages

> (load "bare.lsp" :verbose nil) (si::top-level)
;;; Loading "clos/load.lsp"
;;; Loading "cmp/load.lsp"
#P"bare.lsp"
> ECL (Embeddable Common-Lisp) 0.9d
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
	ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  Top level.
> (funcall (formatter "~@<~@:>") t)
The function STREAM is undefined.
Top level.
>> :b
Backtrace: SI:EVAL-WITH-ENV > si::tpl > si::default-debugger > 
si:universal-error-handler > si::interpret-format-logical-block > 
si::<-format-directive-interpreter > si::interpret-directive-list > 
si:formatter-aux > lambda > eval > si:eval-with-env
Top level.
>> :p
Broken at SI::TPL.
Broken at SI::TPL.
>> :p
Broken at SI::DEFAULT-DEBUGGER.
Broken at SI::DEFAULT-DEBUGGER.
>> :p
Broken at SI:UNIVERSAL-ERROR-HANDLER.
Broken at SI:UNIVERSAL-ERROR-HANDLER.
>> :p
Broken at SI::INTERPRET-FORMAT-LOGICAL-BLOCK.
Broken at SI::INTERPRET-FORMAT-LOGICAL-BLOCK.
>> :v
Block names: SI::INTERPRET-FORMAT-LOGICAL-BLOCK.
Local variables: 
  STREAM: T
  SI::ORIG-ARGS: NIL
  SI::ARGS: NIL
  SI::PREFIX: NIL
  SI::PER-LINE-P: NIL
  SI::INSIDES: NIL
  SI::SUFFIX: NIL
  SI::ATSIGNP: T
  SI::ARG: NIL
Broken at SI::INTERPRET-FORMAT-LOGICAL-BLOCK.

Here is where I went back to the lisp sources and looked for the 
INTERPRET-FORMAT-LOGICAL-BLOCK, to find it uses pprint-logical-block. Since 
this macro is not implemented, the statement (stream arg :per-line-prefix 
prefix :suffix suffix) is evaluated and gives rise to the error.

Happy hacking,

Juanjo





More information about the ecl-devel mailing list