Coverage report: /home/runner/work/geb/geb/src/specs/poly-printer.lisp
Kind | Covered | All | % |
expression | 0 | 16 | 0.0 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;; We use CL streams as they are much better for concatenating to, and
2
;; have us worry less. they are a mutable interface however.
4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
;; FORMAT RUNDOWN FOR THOSE WHO ARE UNFAMILIAR
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8
;; https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node257.html
10
;; DSL FOR NEWLINES AND CONTROL OF IT
12
;; ~4I = (pprint-indent :block 4)
13
;; ~4:I = (pprint-indent :current 4)
14
;; ~_ = (pprint-newline :linear)
15
;; ~@_ = (pprint-newline :miser)
16
;; ~:@_ = (pprint-newline :mandatory)
17
;; ~:_ = (pprint-newline :fill)
20
;; FOR PRINTING NORMALLY NOTE THESE TAKE ARGUMENTS!
22
;; ~(~a~) = print symbol lower case instead of upper case
23
;; ~{~A~} = prints a list element by element.
25
;; ~{~A~^ ~} = prints a list element by element, the last element of
26
;; the list does not print the extra space
28
;; CL-USER> (format nil "~{~A~^ ~}" (list 1 2 3 4 5))
30
;; CL-USER> (format nil "~{~A ~}" (list 1 2 3 4 5))
34
(in-package #:geb.poly.spec)
36
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
37
;; Subst Constructor Printer
38
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
40
;; we are going to be super lazy about this, just make a format
41
(defmacro easy-printer (class-name)
42
`(defmethod print-object ((obj ,class-name) stream)
45
(mapcar #'cdr (geb.mixins:to-pointwise-list obj))))))
52
(easy-printer compose)
53
(easy-printer if-zero)
56
(defmethod print-object ((obj ident) stream)
57
(print-unreadable-object (obj stream :type nil :identity nil)
58
(format stream "IDENT")))