[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 Bugs from the KCL or AKCL reader:



> 
> The following illustrates two lisp reader bugs:
> the first one is a bug on reading a simple reentrant structure,
  ...

In order to make the ## reader macro work inside the #S reader macro in KCL:
   1) Insert the lines:
	   case t_structure:
	   {
		  int i;

		  for (i = 0; i < x->str.str_length; i++)
			  x->str.str_self[i] = patch_sharp(x->str.str_self[i]);
		  break;
	   }
      into the switch statement in the definition of the function patch_sharp
      (in c/read.d).
   2) Change the form (read stream) contained in the function sharp-s-reader
      (in lsp/defstruct.lsp, and maybe also in lsp/iolib.lsp) to 
      (read stream t nil t).

weber.cs.rpi.edu[21]: kcl -init
AKCL (Austin Kyoto Common Lisp)  July 9, 1989
Contains Enhancements by W. Schelter and R. Harris
See the file /us7/oocade/harrisr/lisp/xkcl/doc/README
for notes on this implementaion of Common Lisp.

>(defstruct foo self)
FOO

>(progn (setq x #1=#S(FOO :SELF #1#)) (type-of x))
FOO

>(eq x (foo-self x))
T

>#1=#S(FOO :SELF #1#)
#S(FOO SELF
       #S(FOO SELF
              #S(FOO SELF
...


Rick Harris