chiark / gitweb /
src/classes.lisp, src/class-finalize-impl.lisp: Don't export slot writers.
[sod] / src / module-impl.lisp
index 89e1ffb61716d4d8dcf7aa037210a372f1c77738..08679ce9298aa96f4948dc1c0494ec12bf653972 100644 (file)
@@ -45,7 +45,7 @@ (defmethod shared-initialize :after ((module module) slot-names &key pset)
 
 (defmethod finalize-module ((module module))
   (let* ((pset (module-pset module))
-        (class (get-property pset :lisp-class :symbol 'module)))
+        (class (get-property pset :module-class :symbol 'module)))
 
     ;; Always call `change-class', even if it's the same one; this will
     ;; exercise the property-set fiddling in `shared-initialize' and we can
@@ -144,11 +144,10 @@ (defmethod module-import ((class sod-class))
 ;;;--------------------------------------------------------------------------
 ;;; Code fragments.
 
-(export 'c-fragment)
+(export '(c-fragment c-fragment-text))
 (defclass c-fragment ()
-  ((location :initarg :location :type file-location
-            :accessor c-fragment-location)
-   (text :initarg :text :type string :accessor c-fragment-text))
+  ((location :initarg :location :type file-location :reader file-location)
+   (text :initarg :text :type string :reader c-fragment-text))
   (:documentation
    "Represents a fragment of C code to be written to an output file.
 
@@ -167,7 +166,8 @@ (defun output-c-excursion (stream location thunk)
         (line (file-location-line location))
         (filename (file-location-filename location)))
     (cond (line
-          (format stream "~&#line ~D~@[ ~S~]~%" line filename)
+          (when (typep stream 'position-aware-stream)
+            (format stream "~&#line ~D~@[ ~S~]~%" line filename))
           (funcall thunk)
           (when (typep stream 'position-aware-stream)
             (fresh-line stream)
@@ -180,7 +180,7 @@ (defun output-c-excursion (stream location thunk)
 
 (defmethod print-object ((fragment c-fragment) stream)
   (let ((text (c-fragment-text fragment))
-       (location (c-fragment-location fragment)))
+       (location (file-location fragment)))
     (if *print-escape*
        (print-unreadable-object (fragment stream :type t)
          (when location