Changeset 8893


Ignore:
Timestamp:
Mar 26, 2008, 2:40:26 PM (11 years ago)
Author:
mb
Message:

Use ccl::validate-function-name instead of writing it ourselves (poorly).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lib/source-files.lisp

    r8890 r8893  
    1515;;;   http://opensource.franz.com/preamble.html
    1616
    17 ;;;; RECORD-SOURCE-FILE and FIND-DEFINITIONS-FOR-NAME allow us to map names to source-notes.
     17(in-package "CCL")
     18
     19(setf (fdefinition 'record-source-file) #'early-record-source-file
     20      (fdefinition 'register-definition-type) #'early-register-definition-type)
     21
     22;;;; * Mapping names of things to the text which defines the thing.
     23
     24;;;; RECORD-SOURCE-FILE stores the mapping between a thing and its
     25;;;; location. FIND-DEFINITIONS-FOR-NAME allows us to find all the known places where a thing is
     26;;;; defined.
    1827
    1928;;;; A source-note is a ccl::source-note object, depending on how much information we have available
     
    2332;;;; the name => atom | (list name*)
    2433
    25 (in-package "CCL")
    26 
    27 (setf (fdefinition 'record-source-file) #'early-record-source-file
    28       (fdefinition 'register-definition-type) #'early-register-definition-type)
    29 
    30 ;;;; * Mapping names of things to the text which defines the thing.
     34;;;; * Global tables which store the mappings.
    3135
    3236(defvar *source-files* (make-hash-table)
     
    240244;;;; * Definition types
    241245
    242 (defun %assert-function-name-p (name)
    243   (unless (and (eql 'setf (first name)) (symbolp (second name)))
    244     (error "~S is not a valid function name." name)))
    245 
    246246;;;; ** function
    247247
     
    255255
    256256(define-definition-name-function function (cons)
    257   (%assert-function-name-p cons)
     257  (validate-function-name cons)
    258258  cons)
    259259
     
    272272          (when (macro-function name)
    273273            (list (list 'compiler-macro name)))))
     274
     275;;;; *** function like things
     276
     277(define-definition-type macro (function-definition-type))
     278
     279(define-definition-type compiler-macro (function-definition-type))
    274280
    275281(define-definition-type generic-function (function-definition-type))
     
    386392(defmethod auxilliary-names ((type variable-definition-type) (name symbol))
    387393  (list (list 'constant name)))
    388 
    389 ;;;; ** compiler-macro
    390 
    391 (define-definition-type compiler-macro ()
    392   (:default-name-function symbol))
    393 
    394 (define-definition-short-name compiler-macro (name)
    395   (if (symbolp name)
    396     name
    397     (second name)))
    398 
    399 (define-definition-name-function compiler-macro (cons)
    400   (%assert-function-name-p cons)
    401   cons)
    402394
    403395;;;; ** conditions
     
    494486          (when (atom info) (setq info `((function . ,info))))
    495487          (dolist (pair info)
    496           (let* ((indicator (car pair))
    497                  (path (cdr pair))
    498                  (note (find-source-note path)))
    499             (push (list indicator s note) *early-source-files*))))))))
    500 
    501        
    502      
    503    
    504 
     488            (let* ((indicator (car pair))
     489                   (path (cdr pair))
     490                   (note (find-source-note path)))
     491              (push (list indicator s note) *early-source-files*))))))))
    505492
    506493;; Now that the real r-s-f framework is ready we can go back and fixup the early stuff. This early
     
    514501  do (real-register-definition-type type-name))
    515502
    516 
    517503(loop
    518504  while *early-source-files*
Note: See TracChangeset for help on using the changeset viewer.