git.fiddlerwoaroof.com
Browse code

Add method name to split-out defmethods

fiddlerwoaroof authored on 18/03/2016 05:43:47
Showing 1 changed files
... ...
@@ -35,36 +35,36 @@
35 35
   (:documentation "Prints the appropriate control sequence to the stream passed in
36 36
                    The :before method will print the Tilde."))
37 37
 
38
-(defmethod ((commands list) s)
38
+(defmethod print-format-representation ((commands list) s)
39 39
   (dolist (command commands)
40 40
     (print-format-representation command s)))
41 41
 
42
-(defmethod ((literal character) s)
42
+(defmethod print-format-representation ((literal character) s)
43 43
   (princ literal s))
44 44
 
45
-(defmethod ((literal string) s)
45
+(defmethod print-format-representation ((literal string) s)
46 46
   (princ literal s))
47 47
 
48
-(defmethod :around ((command format-string-command) s)
48
+(defmethod print-format-representation :around ((command format-string-command) s)
49 49
   (princ #\~ s)
50 50
   (call-next-method))
51 51
 
52
-(defmethod :before ((command format-string-command) s)
52
+(defmethod print-format-representation :before ((command format-string-command) s)
53 53
   (when (colon-p command)
54 54
     (princ #\: s))
55 55
   (when (at-p command)
56 56
     (princ #\@ s)))
57 57
 
58
-(defmethod :before ((command simple-format-string-command) s)
58
+(defmethod print-format-representation :before ((command simple-format-string-command) s)
59 59
   (print-format-modifiers command s))
60 60
 
61
-(defmethod ((command simple-format-string-command) s)
61
+(defmethod print-format-representation ((command simple-format-string-command) s)
62 62
   (princ (format-char command) s))
63 63
 
64
-(defmethod :before ((command compound-format-string-command) s)
64
+(defmethod print-format-representation :before ((command compound-format-string-command) s)
65 65
   (print-format-modifiers command s))
66 66
 
67
-(defmethod ((command compound-format-string-command) s)
67
+(defmethod print-format-representation ((command compound-format-string-command) s)
68 68
   (princ (start-char command) s)
69 69
   (print-format-representation (contents command) s)
70 70
   (princ #\~ s)
... ...
@@ -119,18 +119,13 @@
119 119
       (mapcar #'form-step (macroexpand forms))
120 120
       *format-stream*)))
121 121
 
122
-(defun %define-format-char (name format-char closing-char &key at-p colon-p)
123
-  ;; TODO: implement closing-char when we implement the block constructs.
124
-  (declare (ignore closing-char))
122
+(defun define-simple-format-char (name format-char &key at-p colon-p)
125 123
   (setf (gethash (intern (string name) :keyword)
126 124
                  *format-string-registry*)
127 125
         `(simple-format-string-command :format-char ,format-char
128 126
                                        :at-p ,at-p
129 127
                                        :colon-p ,colon-p)))
130 128
 
131
-(defun define-simple-format-char (name format-char &key at-p colon-p)
132
-  (%define-format-char name format-char nil :at-p at-p :colon-p colon-p))
133
-
134 129
 (defun define-compound-format-char (name start-char end-char &key at-p colon-p)
135 130
   (setf (gethash (intern (string name) :keyword)
136 131
                  *format-string-registry*)