From: Mark Wooding Date: Tue, 22 Sep 2015 10:27:11 +0000 (+0100) Subject: src/module-impl.lisp: Eliminate `define-fragment'. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/b3354e08ea601fe2420c15a9a16d1f6d5b98a897 src/module-impl.lisp: Eliminate `define-fragment'. 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. --- diff --git a/src/module-impl.lisp b/src/module-impl.lisp index 1e1f662..c15edda 100644 --- a/src/module-impl.lisp +++ b/src/module-impl.lisp @@ -207,24 +207,6 @@ (defclass code-fragment-item () (: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.