Ignore:
Timestamp:
01/04/12 20:34:38 (10 years ago)
Author:
Mark Evenson
Message:

Convert EQL-SPECIALIZER from a structure into a CLOS class.

From rudi at constantly.

Backout creation of Specializer.java and Equalizer.java (do it all in
Lisp).

From: Rudi Schlatte <rudi@…>
Date: Wed, 4 Jan 2012 17:22:59 +0100
Subject: [PATCH] Convert EQL-SPECIALIZER from a structure into a CLOS class.

... open-code make-instance machinery in intern-eql-specializer to break

circular dependency between it and generic functions working

... also remove unused Java classes for metaobject and

specializer introduced in previous patches (Java-side, they
are just instances of StandardClass?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r13701 r13715  
    11791179    name))
    11801180
    1181 (defstruct eql-specializer
    1182   object)
    1183 
    11841181(defparameter *eql-specializer-table* (make-hash-table :test 'eql))
    11851182
     
    11871184  (or (gethash object *eql-specializer-table*)
    11881185      (setf (gethash object *eql-specializer-table*)
    1189             (make-eql-specializer :object object))))
     1186            ;; we will be called during generic function invocation
     1187            ;; setup, so have to rely on plain functions here.
     1188            (let ((instance (std-allocate-instance (find-class 'eql-specializer))))
     1189              (setf (std-slot-value instance 'sys::object) object)
     1190              instance))))
    11901191
    11911192;; MOP (p. 216) specifies the following reader generic functions:
     
    14441445  (cond ((classp specializer)
    14451446         specializer)
    1446         ((eql-specializer-p specializer)
     1447        ((typep specializer 'eql-specializer)
    14471448         specializer)
    14481449        ((symbolp specializer)
     
    18101811                               (function (or (%method-fast-function method)
    18111812                                             (%method-function method))))
    1812                           (if (eql-specializer-p specializer)
     1813                          (if (typep specializer 'eql-specializer)
    18131814                              (let ((specializer-object (eql-specializer-object specializer)))
    18141815                                #'(lambda (arg)
     
    19661967                (spec2 (nth index specializers-2)))
    19671968            (unless (eq spec1 spec2)
    1968               (cond ((eql-specializer-p spec1)
     1969              (cond ((typep spec1 'eql-specializer)
    19691970                     (return t))
    1970                     ((eql-specializer-p spec2)
     1971                    ((typep spec2 'eql-specializer)
    19711972                     (return nil))
    19721973                    (t
     
    19801981              (spec2 (car specializers-2)))
    19811982          (unless (eq spec1 spec2)
    1982             (cond ((eql-specializer-p spec1)
     1983            (cond ((typep spec1 'eql-specializer)
    19831984                   (return t))
    1984                   ((eql-specializer-p spec2)
     1985                  ((typep spec2 'eql-specializer)
    19851986                   (return nil))
    19861987                  (t
Note: See TracChangeset for help on using the changeset viewer.