[Openmcl-devel] More CLIM Issues

Rainer Joswig joswig at lisp.de
Thu Aug 4 13:09:55 PDT 2016


If you look at the function   find-presentation-type-class   , it gets called with an environment  compile-file (a symbol).
That kind of environment is not in standard Common Lisp.
The code calls FIND-CLASS with this environment then, where it then fails.

As you can see, there is code for allegro, which changes the environment, first:

#+allegro (setq environment (compile-file-environment-p environment))

I would guess that all ANSI CL implementation would need to do that, given a useful implementation of  the function compile-file-environment-p.

What you want:  FIND-CLASS should find the right class object in the right environment.  The symbol  COMPILE-FILE  is not an environment  for Clozure CL, so you need to call (setq environment (compile-file-environment-p environment))   to set it to a useful value.

Regards,

Rainer


(defun find-presentation-type-class (name &optional (errorp t) environment)
  #+Genera (declare (inline compile-file-environment-p))
  #+allegro (setq environment (compile-file-environment-p environment))
  (macrolet ((not-found (name)
               `(if (gethash name *presentation-type-abbreviation-table*)
                    (error "~S is a presentation type abbreviation, not the name of a presentation type" ,name)
                    (error "~S is not the name of a presentation type" ,name))))
    (typecase name
      (symbol
        (let ((compile-file-environment-p (compile-file-environment-p environment)))
          (or (and (eq name (first *presentation-type-being-defined*))
                   (second *presentation-type-being-defined*))
              (if compile-file-environment-p
                  (compile-time-property name 'presentation-type-class)
                  (gethash name *presentation-type-class-table*))
              (let ((class (find-class name nil environment)))                                ;  <- fails probably here
                (and (acceptable-presentation-type-class class)
                     class))
              (when compile-file-environment-p
                ;; compile-file environment inherits from the run-time environment
                (or (gethash name *presentation-type-class-table*)
                    (let ((class (find-class name nil nil)))
                      (and (acceptable-presentation-type-class class)
                           class))))
              (and errorp (not-found name)))))
      ((satisfies acceptable-presentation-type-class)
       name)
      (otherwise        ;a type error should complain even if errorp is nil
        (not-found name)))))


Regards.

Rainer




> Am 04.08.2016 um 21:19 schrieb Craig Lanning <craig.t.lanning at gmail.com>:
> 
> I'm making a little progress (I think).
> 
> When I compile the CLIM Silica system, I see complaints about undefined
> functions.  Some of these are slot accessor functions that don't get
> defined until CLIM Standalone is compiled.
> 
> Anyway, I compile and load CLIM Utils, CLIM Silica, and then CLIM
> Standalone.
> 
> While compiling CLIM Standalone, it runs into the following error:
> 
> ;; Compiling clim:clim;accept-values.lisp.newest
> ;Compiler warnings for "clim:clim;accept-values.lisp.newest" :
> ;   In (PROMPT-FOR-ACCEPT (ACCEPT-VALUES-STREAM T T)) inside an
> anonymous lambda form: Unused lexical variable ACCEPT-ARGS
>> Error: The value COMPILE-FILE is not of the expected type
> CCL::LEXICAL-ENVIRONMENT.
>> While executing: CCL::DEFINITION-ENVIRONMENT, in process listener(1).
>> Type :POP to abort, :R for a list of available restarts.
>> Type :? for other options.
> 1 > :b
> 
> Attached is the entire output from doing the compiles and the output of
> the :b command.
> 
> The problem here is that I'm not even sure where to look for the real
> problem.  In CLIM Utils, there were a few things that touched on the
> environment.  I think I added the appropriate #+/#- things to that
> code.
> 
> Can anyone tell me anything that might help me figure out what the real
> problem is?
> 
> Craig
> <output.txt>_______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list