patch - defsystem - language-support.lisp - canonicalizing defclass calls; generic-function lambda

Sean Champ <[email protected]> Mon, 31 Jul 2006 05:19:32 -0700
Newsgroups gmane.lisp.clocc.devel
Message-ID <[email protected]>
The patch attached to this message affects the file
src/defsystem-4/src/language-support.lisp in the CLOCC CVS repository. 

In the patch:

- some DEFCLASS calls, such that are made with no slot specifiers and no
class initargs, are defined as to have a NIL value in the slot-specifiers
spot of the DEFCLASS call. This is in keeping with the canonical DEFCLASS
syntax, required of some Common Lisp implementations.

- a defgeneric lambda-list is modified, as to remove the initforms that had
been specified on keyword arguments to the lambda-list.

- some whitespace that was at the end of some lines has been removed from
the text. This was done, automatically, in some operations executed during
the Emacs write-file hook, and origined of the 'nuke-trailing-whitespace'
emacs lisp library. That library is  available in the Debian package
emacs-goodies-el,a s well as via  a cvsweb interface on the package, at the
URL:
http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/emacs-goodies-el/elisp/emacs-goodies-el/nuke-trailing-whitespace.el?cvsroot=pkg-goodies-el


--
Sean

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
clocc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clocc-devel
defsystem.language-support.diff (text/x-diff, 5.2 KB)
Index: language-support.lisp
===================================================================
RCS file: /cvsroot/clocc/clocc/src/defsystem-4/src/language-support.lisp,v
retrieving revision 1.8
diff -p -u -u -u -u -r1.8 language-support.lisp
--- language-support.lisp	27 Nov 2002 01:24:55 -0000	1.8
+++ language-support.lisp	31 Jul 2006 12:01:02 -0000
@@ -13,7 +13,7 @@
 ;;; This section is used for defining language-specific behavior of
 ;;; defsystem. If the user changes a language definition, it should
 ;;; take effect immediately -- they shouldn't have to reload the
-;;; system definition file for the changes to take effect. 
+;;; system definition file for the changes to take effect.
 
 
 ;;; Notes.
@@ -94,13 +94,17 @@ It is keyed by keywords.")
 
 
 
-(defclass language-compiler (language-processor))
+(defclass language-compiler (language-processor)
+  ())
 
-(defclass language-loader (language-processor))
+(defclass language-loader (language-processor)
+  ())
 
-(defclass language-linker (language-processor))
+(defclass language-linker (language-processor)
+  ())
 
-(defclass language-interpreter (language-processor))
+(defclass language-interpreter (language-processor)
+  ())
 
 
 ;;; object-loader --
@@ -150,7 +154,7 @@ object file into a running CL."))
 
 
 ;;; language class.
-  
+
 (defclass language ()
   ((name :reader language-name
 	 :type symbol
@@ -167,7 +171,7 @@ object file into a running CL."))
 			function
 			language-processor)
 	      :initarg :processor)
-	     
+
    (loader :accessor language-loader	; As above.
 	   :type (or null
 		     function
@@ -190,7 +194,7 @@ object file into a running CL."))
     :accessor language-source-extension
     :type (or null string)
     :initarg :source-extension)		; Filename extensions for
-					; source files. 
+					; source files.
    (binary-extension
     :accessor language-binary-extension
     :type (or null string)
@@ -230,10 +234,10 @@ object file into a running CL."))
 ;;; used. Otherwise the functions are derived from the language. If no
 ;;; language is specified, it defaults to Common Lisp (:lisp). Other current
 ;;; possible languages include :scheme (PseudoScheme) and :c, but the user
-;;; can define additional language mappings. Compilation functions should 
+;;; can define additional language mappings. Compilation functions should
 ;;; accept a pathname argument and a :output-file keyword; loading functions
 ;;; just a pathname argument. The default functions are #'compile-file and
-;;; #'load. Unlike fdmm's SET-LANGUAGE macro, this allows a defsystem to 
+;;; #'load. Unlike fdmm's SET-LANGUAGE macro, this allows a defsystem to
 ;;; mix languages.
 
 (defclass component-language-mixin ()
@@ -247,7 +251,7 @@ object file into a running CL."))
 					; to make the overriding
 					; machinery to work at
 					; definition time.
-  
+
   (:documentation
    "The Language Mixin Class.
 A 'mixin' class used to specify the (progamming) `language' of the content."))
@@ -263,7 +267,7 @@ A 'mixin' class used to specify the (pro
 		   :type list)
    )
   (:default-initargs :loader nil)
-  (:documentation 
+  (:documentation
    "A `mixin' class used to specify that a component is `loadable'.
 The `loader' slot contains a function or an instance of the specific
 `loader' to be used to perform the operation.
@@ -538,7 +542,7 @@ The result is a list of keywords."))
 	   (type (or null pathname) error-file)
 	   (type (or null stream (member t)) error-output)
 	   (type boolean verbose))
-  
+
   (flet ((make-compound-stream (&rest streams)
 	   (apply #'make-broadcast-stream (delete nil streams)))
 	 )
@@ -583,7 +587,7 @@ The result is a list of keywords."))
 			     (simple-condition-format-control e)
 			     (simple-condition-format-arguments e)
 			     )))
-	       
+
 	     (setf output-file-written-p
 		   (and (probe-file output-file)
 			(or (null old-timestamp)
@@ -593,7 +597,7 @@ The result is a list of keywords."))
 	     (when output-file-written-p
 	       (user-message verbose-stream "~A written."
 			     output-file))
-	     
+
 	     (user-message verbose-stream
 			   "running of ~S completed~@[ with errors~]."
 			   program
@@ -602,7 +606,7 @@ The result is a list of keywords."))
 	     (values (and output-file-written-p output-file)
 		     fatal-error
 		     fatal-error))))
-	   
+
        (error (e)
 	      (format *error-output* "~S" e)
 	      (when error-file
@@ -685,11 +689,18 @@ The result is a list of keywords."))
 ;;; History. This was in the language/c/c.lisp file.
 
 (defgeneric load-object-file (loadable-c-pahtname
+			      &key print verbose libraries)
+
+  #| Recommended form for the lambda list, on methods to this function:
+
+  (loadable-c-pahtname
 			      &key
 			      (print *load-print*)
 			      (verbose *load-verbose*)
 			      (libraries '("c"))
 			      )
+
+|#
   (:documentation
    "Loads a C object file (or similar) into the CL environment."))
 
@@ -771,7 +782,7 @@ The result is a list of keywords."))
 ;;; Test System for verifying multi-language capabilities.
 (defsystem foo
   :language :lisp
-  :components ((:module c :language :c :components ("foo" "bar")) 
+  :components ((:module c :language :c :components ("foo" "bar"))
 	       (:module lisp :components ("baz" "barf"))))
 
 ||#