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

Re: issue CONSTANT-CIRCULAR-COMPILATION, version 4



> Proposal:  CONSTANT-CIRCULAR-COMPILATION:FLAG
> 
> Add to the definition of Common Lisp a special variable:
> 
> *DUMP-CIRCLE*						[Special variable]
> 
> State that if the (compile-time) value of *DUMP-CIRCLE* is NIL, it is
> an error for an object containing a circular reference to appear as a
> constant to be compiled.  State that the compiler is required to
> preserve EQness of substructures within a file compiled with
> COMPILE-FILE when *DUMP-CIRCLE* is non-NIL. 

But then someone would want to do something like 

  (COMPILER-LET ((*DUMP-CIRCLE* T))
    (DEFUN FOO (...)
      ... 
      (... '#.(CIRCULAR-LIST ...) ...)...))

which raises some questions:

  1. Is this flag still useful if COMPILER-LET is eliminated?
  2. How much of the code does the COMPILER-LET have to surround in
     order to be effective? 
  3. Is it even possible to control this during compilation?  [In our
     implementation, COMPILER-LET and (EVAL-WHEN (COMPILE) ...) both
     happen only during pass 1, but the circularity would have to be
     dealt with in the final output pass.]

Or would you say:

  (EVAL-WHEN (COMPILE) 
    (UNLESS *DUMP-CIRCLE* 
      (ERROR "This file needs to be compiled with *DUMP-CIRCLE* true.")))