clocc defsystem and gcl



--Boundary_(ID_v6o7tyYen3p4yAhaiIeT8A)
Content-type: text/plain
Content-transfer-encoding: 7BIT

Hi,

Maxima has been maintaining its own fork of clocc's defsystem in order
to support gcl. All along, I have been meaning to try to get the gcl
changes back into the main clocc repository. I am finally motivated to
do so. Before I offer a patch, however, I thought I should discuss it
here to see if any of the gcl developers have any comments.

I am not an ANSI Lisp language lawyer. Given that disclaimer, here is my
summary of the non-standard features of GCL that require changes in
defsystem:

1) gcl doesn't understand the modern keyword arguments to eval-when like
:compile-toplevel and :load-toplevel

2) The ignore-errors function is in the conditions package.

3) gcl is missing with-compilation-unit.

4) ensure-directories-exist is documented, but doesn't seem to exist in
my ansi gcl. (???)

5) Maxima gives :system-p t to the compile function, but I don't know
why.

I've attached a context diff between the clocc defsystem and Maxima's
current defsytem (which, obviously, works with gcl).

--Jim


--Boundary_(ID_v6o7tyYen3p4yAhaiIeT8A)
Content-type: text/x-patch; name=defsystem.diff; charset=ANSI_X3.4-1968
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=defsystem.diff

*** /home/amundson/transfer/clocc/src/defsystem-3.x/defsystem.lisp	2003-09-27 05:00:35.000000000 -0500
--- defsystem.lisp	2003-11-07 05:44:35.000000000 -0600
***************
*** 871,879 ****
        :cormanlisp
        :scl
        (and allegro-version>= (version>= 4 1)))
! (eval-when #-(or :lucid)
             (:compile-toplevel :load-toplevel :execute)
! 	   #+(or :lucid)
             (compile load eval)
  
    (unless (or (fboundp 'lisp::require)
--- 871,879 ----
        :cormanlisp
        :scl
        (and allegro-version>= (version>= 4 1)))
! (eval-when #-(or :lucid :gcl)
             (:compile-toplevel :load-toplevel :execute)
! 	   #+(or :lucid :gcl)
             (compile load eval)
  
    (unless (or (fboundp 'lisp::require)
***************
*** 993,998 ****
--- 993,1002 ----
  #+(or clisp cormanlisp ecl (and gcl defpackage) sbcl)
  (defpackage "MAKE" (:use "COMMON-LISP") (:nicknames "MK"))
  
+ #+gcl
+ (defpackage "MAKE" (:use "LISP" "SYSTEM") (:nicknames "MK")
+              (:import-from conditions ignore-errors))
+ 
  #-(or :sbcl :cltl2 :lispworks :ecl :scl)
  (in-package "MAKE" :nicknames '("MK"))
  
***************
*** 1428,1434 ****
  ;;; ********************************
  ;;; Component Operation Definition *
  ;;; ********************************
! (eval-when (:compile-toplevel :load-toplevel :execute)
  (defvar *version-dir* nil
    "The version subdir. bound in operate-on-system.")
  (defvar *version-replace* nil
--- 1432,1441 ----
  ;;; ********************************
  ;;; Component Operation Definition *
  ;;; ********************************
! (eval-when #-(or :lucid :gcl)
! 	   (:compile-toplevel :load-toplevel :execute)
! 	   #+(or :lucid :gcl)
! 	   (compile load eval)
  (defvar *version-dir* nil
    "The version subdir. bound in operate-on-system.")
  (defvar *version-replace* nil
***************
*** 3358,3366 ****
    (declare #-(or :cltl2 :ansi-cl) (ignore override-compilation-unit))
    (unwind-protect
        ;; Protect the undribble.
!       (#+(or :cltl2 :ansi-cl) with-compilation-unit
! 	 #+(or :cltl2 :ansi-cl) (:override override-compilation-unit)
! 	 #-(or :cltl2 :ansi-cl) progn
  	(when *reset-full-pathname-table* (clear-full-pathname-tables))
  	(when dribble (dribble dribble))
  	(when test (setq verbose t))
--- 3365,3374 ----
    (declare #-(or :cltl2 :ansi-cl) (ignore override-compilation-unit))
    (unwind-protect
        ;; Protect the undribble.
!       (#+(and (or :cltl2 :ansi-cl) (not :gcl)) with-compilation-unit
! 	 #+(and (or :cltl2 :ansi-cl) (not :gcl)) 
! 	 (:override override-compilation-unit)
! 	 #-(and (or :cltl2 :ansi-cl) (not :gcl)) progn
  	(when *reset-full-pathname-table* (clear-full-pathname-tables))
  	(when dribble (dribble dribble))
  	(when test (setq verbose t))
***************
*** 3786,3793 ****
  ;;; if anybody does a funcall on #'require.
  
  ;;; Redefine old require to call the new require.
! (eval-when #-(or :lucid) (:load-toplevel :execute)
! 	   #+(or :lucid) (load eval)
  (unless *old-require*
    (setf *old-require*
  	(symbol-function
--- 3794,3801 ----
  ;;; if anybody does a funcall on #'require.
  
  ;;; Redefine old require to call the new require.
! (eval-when #-(or :lucid :gcl) (:load-toplevel :execute)
! 	   #+(or :lucid  :gcl) (load eval)
  (unless *old-require*
    (setf *old-require*
  	(symbol-function
***************
*** 4207,4212 ****
--- 4215,4221 ----
  	 ;; Ugly, but seems to fix the problem.
  	 (concatenate 'string "./" namestring))))
  
+ #+:gcl(defun ensure-directories-exist (arg0 &key verbose) ())
  (defun compile-file-operation (component force)
    ;; Returns T if the file had to be compiled.
    (let ((must-compile
***************
*** 4243,4248 ****
--- 4252,4258 ----
  			  source-pname
  			  :output-file
  			  output-file
+ 			  #+gcl :system-p #+gcl t
  			  #+(or :cmu :scl) :error-file
  			  #+(or :cmu :scl) (and *cmu-errors-to-file*
  						(component-full-pathname component

--Boundary_(ID_v6o7tyYen3p4yAhaiIeT8A)--