Paste number 30735: | why extra linebreak? |
Pasted by: | puchacz |
When: | 18 years, 3 months ago |
Share: | Tweet this! | http://paste.lisp.org/+NPR |
Channel: | #lisp |
Paste contents: |
BUBRARY> (defclass my-class () ())
#<STANDARD-CLASS MY-CLASS>
BUBRARY> (defmethod print-object ((o my-class) stream) (print "my-class" stream))
#<STANDARD-METHOD PRINT-OBJECT (MY-CLASS T) {BFA0A19}>
BUBRARY> (make-instance 'my-class)
"my-class"
BUBRARY>
Annotations for this paste:
Annotation number 1: | I discovered that the simplest way to do it is |
Pasted by: | puchacz |
When: | 18 years, 3 months ago |
Share: | Tweet this! | http://paste.lisp.org/+NPR/1 |
Paste contents: |
(defun dict (dict mnemonic)
(object dict `(mnemonic ,mnemonic)))
(defmethod print-object ((object dictionary) stream)
(print (list 'dict `',(class-name (class-of object)) (if (mnemonic object) `',(mnemonic object) nil))))
Annotation number 2: | debugging example |
Pasted by: | puchacz |
When: | 18 years, 3 months ago |
Share: | Tweet this! | http://paste.lisp.org/+NPR/2 |
Paste contents: |
(defmethod editor->model ((o rich-text))
(setf (content o) (client-value (content-editor (get-editor o))))
(break)
(editor->model (rich-text-type o)))