src/module-impl.lisp: Eliminate `define-fragment'.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Sep 2015 10:27:11 +0000 (11:27 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 23 Sep 2015 09:00:45 +0000 (10:00 +0100)
It had a severely deficient interface: it could only define fragments
with constant contents.  Moreover, although it made an effort to accept
a string-literal as its text, it ended up in a tangle because
`code-fragment-item' insists on its `fragment' slot actually containing
a code fragment, and nothing does the conversion.

Rather than fix these bugs, I noticed that nothing actually used it at
all, so removing it completely seemed like a better option.

src/module-impl.lisp

index 1e1f662..c15edda 100644 (file)
   (:documentation
    "A plain fragment of C to be dropped in at top-level."))
 
-(defmacro define-fragment ((reason name) &body things)
-  (categorize (thing things)
-      ((constraints (listp thing))
-       (frags (typep thing '(or string c-fragment))))
-    (when (null frags)
-      (error "Missing code fragment"))
-    (when (cdr frags)
-      (error "Multiple code fragments"))
-    `(add-to-module
-      *module*
-      (make-instance 'code-fragment-item
-                    :fragment ',(car frags)
-                    :name ,name
-                    :reason ,reason
-                    :constraints (list ,@(mapcar (lambda (constraint)
-                                                   (cons 'list constraint))
-                                                 constraints))))))
-
 ;;;--------------------------------------------------------------------------
 ;;; File searching.