Changeset 11809


Ignore:
Timestamp:
05/01/09 19:26:40 (13 years ago)
Author:
ehuelsmann
Message:

Use a single routine to calculate the classfile pathname in two places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compile-file.lisp

    r11808 r11809  
    4040(defvar *output-file-pathname*)
    4141
     42(declaim (ftype (function (t) t) compute-classfile-name))
     43(defun compute-classfile-name (n &optional (output-file-pathname
     44                                            *output-file-pathname*))
     45  "Computes the name of the class file associated with number `n'."
     46  (let ((name
     47         (%format nil "~A-~D"
     48                  (substitute #\_ #\.
     49                              (pathname-name output-file-pathname)) n)))
     50    (namestring (merge-pathnames (make-pathname :name name :type "cls")
     51                                 output-file-pathname))))
     52
    4253(declaim (ftype (function () t) next-classfile-name))
    4354(defun next-classfile-name ()
    44   (let ((name (%format nil "~A-~D"
    45                        (substitute #\_ #\. (pathname-name *output-file-pathname*))
    46                        (incf *class-number*))))
    47     (namestring (merge-pathnames (make-pathname :name name :type "cls")
    48                                  *output-file-pathname*))))
     55  (compute-classfile-name (incf *class-number*)))
    4956
    5057(defmacro report-error (&rest forms)
     
    472479                 (pathnames ()))
    473480            (dotimes (i *class-number*)
    474               (let* ((file-namestring (%format nil "~A-~D.cls"
    475                                                (substitute #\_ #\. (pathname-name output-file))
    476                                                (1+ i)))
    477                      (pathname (merge-pathnames file-namestring output-file)))
     481              (let* ((pathname (compute-classfile-name (1+ i))))
    478482                (when (probe-file pathname)
    479483                  (push pathname pathnames))))
Note: See TracChangeset for help on using the changeset viewer.