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

Can't abbreviate built-in classes; can't write methods for PATHNAME



1In Symbolics 3620 in Genera 7.2, System 376.166, Experimental Logical Pathnames Translation Files NEWEST, Utilities 27.31, Server Utilities 28.5,
Hardcopy 118.17, Zmail 165.23, LMFS 102.8, Tape 82.19, Nsage 27.246, Extended Help 18.4, Documentation Database 62.1, Mailer 17.1, Print Spooler 16.1,
Domain Name Server 17.1, Experimental ILA-SF-Site-System 1.23, Experimental ILA-SF-Site-Server-System 3.25, microcode 3620-FPA-MIC 420, FEP 208,
fep0:>g208-lisp.flod(4), fep0:>g208-loaders.flod(4), fep0:>g208-debug.flod(2), fep0:>g208-info.flod(4), Machine serial number 20194
on Symbolics 3620 #20194 (Max Fleischer):

0Is there a genuine Bug-PCL mailing list?

Here is exactly what I did:

  (in-package 'test-package :use '(PCL lisp))
  (shadow "INTEGER" 'test-package)
  (deftype integer () 'lisp:integer)
  (defmethod foo ((foo integer)) foo)

I originally wanted to be doing this:

  (in-package 'clim-lisp)
  (shadow 'pathname)
  (deftype pathname () 'lisp:pathname)
  (defmethod pathname ((string string)) (parse-namestring string))
  (defmethod pathname ((pathname pathname)) pathname)
  (defmethod pathname ((stream stream)) (stream-pathname stream))

but PATHNAME is not a PCL built-in class, so I decided to try this with
INTEGER.

1.  What is the right way to do what I want?  Just saying 
  (defclass integer (lisp:integer) ())
    doesn't work: it creates a standard class.  If you then define a
    method on this new class, it can't be invoked (see second backtrace
    below).  You can't create a built-in class by specifying
  (defclass integer (lisp:integer) () (:metaclass pcl:built-in-class))
    because this is prohibited by PCL.

2.  Why isn't PATHNAME a built-in class?

2Error: TEST-PACKAGE::INTEGER used as a specializer,
       but is not the name of a class.
0While in the function (:INTERNAL PCL:PARSE-SPECIALIZERS 0 PCL:PARSE)  PCL:PARSE-SPECIALIZERS  PCL:REAL-ADD-NAMED-METHOD

The condition signalled was SYS:FATAL-ERROR

2(:INTERNAL PCL:PARSE-SPECIALIZERS 0 PCL:PARSE)0  (P.C. = 13)  3(from MAX:>pcl>pcl-for-the-nineties>boot)
2PCL:PARSE-SPECIALIZERS0  (P.C. = 15)  3(from MAX:>pcl>pcl-for-the-nineties>boot)
2PCL:REAL-ADD-NAMED-METHOD0  (P.C. = 11)  3(from MAX:>pcl>pcl-for-the-nineties>methods)
2PCL:LOAD-DEFMETHOD-INTERNAL0  (P.C. = 73)  3(from MAX:>pcl>pcl-for-the-nineties>boot)
2PCL:LOAD-DEFMETHOD0  (P.C. = 36)  3(from MAX:>pcl>pcl-for-the-nineties>boot)


0=================================================================
Second backtrace: I typed 
  (defclass integer (lisp:integer) ())
  (defmethod foo ((foo integer)) foo)
  (foo 4) 
and the following occurred:

4Error: The symbol NIL has an invalid function definition

NIL
0   5Rest Arg: 0(4)

4PCL:INITIAL-DFUN0  5(from MAX:>pcl>pcl-for-the-nineties>dfun)
0   Arg 0 (PCL:ARGS): (4)
   Arg 1 (PCL:GENERIC-FUNCTION): #<Standard-Generic-Function TEST-PACKAGE::FOO (1) 344032735>


#<Standard-Generic-Function TEST-PACKAGE::FOO (1) 203651511> is an instance of class #<Funcallable-Standard-Class PCL:STANDARD-GENERIC-FUNCTION 314064674>:
 The following slots have :INSTANCE allocation:
 SOURCE                        NIL
 PLIST                         NIL
 PRETTY-ARGLIST                NIL
 VALID-P                       NIL
 EFFECTIVE-METHOD-FUNCTIONS    NIL
 DFUN-STATE                    NIL
 ARG-INFO                      #<ART-Q-6 420007274>
 METHOD-COMBINATION            #<Method-Combination PCL:STANDARD NIL 314067643>
 METHOD-CLASS                  #<Standard-Class PCL:STANDARD-METHOD 314066167>
 METHODS                       
(#<Standard-Method TEST-PACKAGE::FOO (TEST-PACKAGE::INTEGER) 420007303>)
 NAME                          TEST-PACKAGE::FOO

#<Standard-Method TEST-PACKAGE::FOO (TEST-PACKAGE::INTEGER) 420007303> is an instance of class #<Standard-Class PCL:STANDARD-METHOD 314066167>:
 The following slots have :INSTANCE allocation:
 PLIST               NIL
 SOURCE              ((PCL:DEFMETHOD TEST-PACKAGE::FOO (TEST-PACKAGE::INTEGER)) NIL)
 FUNCTION            #<SYS:LEXICAL-CLOSURE (LAMBDA # # # ...) 203651526>
 LAMBDA-LIST         (TEST-PACKAGE::FOO)
 SPECIALIZERS        (#<Standard-Class TEST-PACKAGE::INTEGER 420007315>)
 GENERIC-FUNCTION    #<Standard-Generic-Function TEST-PACKAGE::FOO (1) 203651511>

#<Standard-Class TEST-PACKAGE::INTEGER 420007315> is a class, it is an instance of PCL:STANDARD-CLASS.
Its proper name is TEST-PACKAGE::INTEGER.
The direct superclasses are: (INTEGER), and the direct
subclasses are: ().  The class precedence list is:
(TEST-PACKAGE::INTEGER INTEGER RATIONAL NUMBER T)
There are 1 methods specialized for this class.