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

Flavor bug



    Date: Sat, 21 May 88 16:01:05 CDT
    From: gavan@emx.utexas.edu (Gavan Duffy)

       Date: Sat, 21 May 88 14:05 EDT
       From: SWM@SAPSUCKER.SCRC.Symbolics.COM (Scott McKay)

	   Date: Fri, 20 May 88 13:09:38 pdt
	   From: ragosa%psyche@BOEING.COM 

	   The following code causes a crash to the FEP when compiled. A fellow
	   employee discovered it and asked me to forward it to BUG-LISPM and SLUG.
	   It fails under Genera 7.1. The reference to LENGTH is the problem. 

	   ;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-

	   ; Flavor bug. The reference to LENGTH (a CommonLISP function) seems to
	   ; be the culprit. Try to compile this (Note: Prepare for an irrevokable
	   ; crash to the FEP).

	   (defflavor test ((length nil)) ()
	     (:writable-instance-variables (length length)))

       I presume that you at least got a redefinition warning for LENGTH when
       you did this?  If not, that is a bug. 

    Where is length redefined?  It's specified here as an instance variable,
    not a function.  TEST-LENGTH is defined, but not LENGTH.  

Doesn't the (LENGTH LENGTH) in the :WRITABLE-INSTANCE-VARIABLES make a
g-f called LENGTH?

       However, if you did get a redefinition warning, and told it to go
       ahead, then the fact that you lost is not a bug.  LENGTH is a
       critical function, and redefining it is bound to cause you to lose.

    In general, it's helpful to lose gracefully.  I haven't yet been
    courageous enough to try this, so I don't know whether it really throws
    you into the FEP, but if it does that's not very graceful.  

I haven't tried it either.

    The debugger's a much better place to be.

Yup, but if my theory is right about redefining LENGTH, then the
Debugger may not work at all.  (Hmm.  LENGTH is microcoded, though, isn't
it?  I guess I'm just not so sure now.)