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

problem with &key args in defmethod?



(defclass a () nil)

(defmethod a-m1 ((self a) &optional (a-opt :jumbo) &key (a-key :mumbo))
  (with-slots nil self
    (format t "~s, ~s" a-opt a-key)))

This simple example using Rainy and May Day PCL (but not Victoria Day)
causes my Sun/Lucid CL 3.0.2 image to break with:

">>Trap: Bus error"

on the defmethod form.

In fact, I have several defmethod's that crash the system in this
manner.  The only thing I see that they have in common is &key
arguments.  It compiles okay in Victoria Day PCL in Lucid3.0.2 and on my
Genera 7.2 system using May Day.  I haven't tried it in Victoria or
Rainy Day PCL on Genera 7.2.

Appended is the macroexpansion I get on the Lucid 3.0.2 May Day
defmethod form and after that a listing from the debugger.

Any ideas on this?

Thanks for your assistance.

Steve
--
Stephen L. Nicoud  <snicoud@atc.boeing.com>  uw-beaver!bcsaic!snicoud
Boeing Advanced Technology Center for Computer Sciences

(COMPILER-LET
   ((LUCID::*COMPILER-MESSAGE-STRING*
      (OR LUCID::*COMPILER-MESSAGE-STRING*
          "(DEFMETHOD A-M1 (A))")))
   (EVAL-WHEN (COMPILE LOAD EVAL)
              (PCL::LOAD-DEFMETHOD 'STANDARD-METHOD
                                   'A-M1
                                   'NIL
                                   (LIST 'A)
                                   '(SELF &OPTIONAL (A-OPT :JUMBO) &KEY
                                     (A-KEY :MUMBO))
                                   'NIL
                                  'NIL
                                   'NIL
                                   #'(LAMBDA
                                      (SELF &OPTIONAL (A-OPT :JUMBO) &KEY
                                       (A-KEY :MUMBO) &ALLOW-OTHER-KEYS)
                                      (DECLARE (PCL::CLASS SELF A)
                                       (OPTIMIZE (:FAST-ENTRY T)))
                                      (PROGN SELF)
                                      (BLOCK A-M1
                                       ((LAMBDA NIL
                                         (DECLARE (OPTIMIZE (:FAST-ENTRY
T)))
                                         (LET ((#:VALUE5737 SELF))
                                          (DECLARE
                                           (PCL::VARIABLE-REBINDING
#:VALUE5737
                                            SELF))
                                          #:VALUE5737
                                          (FORMAT T "~s, ~s" A-OP
A-KEY)))))))))


> (compile-file "~/key-bug.lisp")
;;; You are using the compiler in production mode (compilation-speed = 0)
;;; Generation of runtime error checking code is disabled (safety = 0)
;;; Tail recursion elimination is enabled (speed = 3)
;;; Reading source file "/home/sanpoil0/snicoud/key-bug.lisp"
;;; Compiling (DEFCLASS A)
;;; Compiling (DEFMETHOD A-M1 (A))
>>Trap: Bus error

LUCID:COMPILE-FORM:
   Required arg 0 (FORM): (LUCID-COMMON-LISP:DEFINE-FUNCTION (QUOTE
LUCID::%TOPLEVEL-THUNK) (FUNCTION (LAMBDA NIL # NIL)))
   Required arg 1 (MODE): LUCID::TOPLEVEL
   Required arg 2 (OUTPUT): #<Compiled-Function LUCID::ASSEMBLE-FORM A1D3F>
   Rest arg 3 (OUTARGS): (#<Compiled-Function LUCID::BACKEND-OUTPUT A2607>
#<Stream OSI-BUFFERED-STREAM "/home/sanpoil0/snicoud/key-bug.lbin" DD06DB>
#<Structure LUCID::FASLSTATE DD1D1B>)
:A  0: Abort to Lisp Top Level

-> :b
LUCID:COMPILE-FORM <- LUCID:COMPILE-FORM <- LUCID:COMPILE-FORM <-
COMPILE-FILE <- EVAL <- SYSTEM:ENTER-TOP-LEVEL
-> :n
LUCID:COMPILE-FORM:
   Required arg 0 (FORM): (EVAL-WHEN (COMPILE LOAD EVAL)
(PCL::LOAD-DEFMETHOD (QUOTE STANDARD-METHOD) (QUOTE A-M1) (QUOTE NIL) (LIST
#) (QUOTE #) (QUOTE NIL) (QUOTE NIL) (QUOTE NIL) (FUNCTION #)))
   Required arg 1 (MODE): LUCID::ALREADY-EVALUATED-IN-COMPILER
   Required arg 2 (OUTPUT): #<Compiled-Function LUCID::ASSEMBLE-FORM A1D3F>
   Rest arg 3 (OUTARGS): (#<Compiled-Function LUCID::BACKEND-OUTPUT A2607>
#<Stream OSI-BUFFERED-STREAM "/home/sanpoil0/snicoud/key-bug.lbin" DD06DB>
#<Structure LUCID::FASLSTATE DD1D1B>)
-> :n
LUCID:COMPILE-FORM:
   Required arg 0 (FORM): (DEFMETHOD A-M1 ((SELF A) &OPTIONAL (A-OPT
:JUMBO) &KEY (A-KEY :MUMBO)) (WITH-SLOTS NIL SELF (FORMAT T "~s, ~s" A-OPT
A-KEY)))
   Required arg 1 (MODE): LUCID::TOPLEVEL
   Required arg 2 (OUTPUT): #<Compiled-Function LUCID::ASSEMBLE-FORM A1D3F>
   Rest arg 3 (OUTARGS): (#<Compiled-Function LUCID::BACKEND-OUTPUT A2607>
#<Stream OSI-BUFFERED-STREAM "/home/sanpoil0/snicoud/key-bug.lbin" DD06DB>
#<Structure LUCID::FASLSTATE DD1D1B>)
-> :n
COMPILE-FILE:
   Required arg 0 (INPUT-PATHNAME): "~/key-bug.lisp"
   Rest arg 1 (KEYS): NIL
   Keyword arg 2 (OUTPUT-FILE): NIL
   Keyword arg 3 (TARGET): NIL
   Keyword arg 4 (BLOCK-COMPILE-PRESCAN): NIL
   Keyword arg 5 (COMPILE-BLOCK): NIL
   Keyword arg 6 (FASLSTATE): NIL
-> :a
Abort to Lisp Top Level
Back to Lisp Top Level
>