minor formal improvements: use eql, print-unreadable-object, string in put with newlines
This commit is contained in:
parent
2111c7313a
commit
dafce6f2d2
4 changed files with 12 additions and 9 deletions
|
@ -18,5 +18,6 @@
|
|||
(make-instance 'message :head head :data data :sender sender))
|
||||
|
||||
(defmethod print-object ((msg message) stream)
|
||||
(format stream "<message ~s ~s <data ~s>>"
|
||||
(shape:head msg) (sender msg) (shape:data msg)))
|
||||
(print-unreadable-object (msg stream :type t :identity t)
|
||||
(format stream "~s ~s <data ~s>"
|
||||
(shape:head msg) (sender msg) (shape:data msg))))
|
||||
|
|
|
@ -56,16 +56,16 @@
|
|||
|
||||
(defun save (track)
|
||||
;(let ((cont ...
|
||||
; (if (eq force-insert :always) (insert track)
|
||||
; (if (eql force-insert :always) (insert track)
|
||||
(let* ((*build-track-data* #'identity) ; keep hash-table for comparison
|
||||
(new-data (alx:plist-hash-table (shape:data track)))
|
||||
(cont (container track))
|
||||
(found (query-last cont (shape:head-plist track)))
|
||||
(force-insert (force-insert-when cont)))
|
||||
(if (or (null found) (eq force-insert :always))
|
||||
(if (or (null found) (eql force-insert :always))
|
||||
(insert track new-data)
|
||||
(unless (equalp (shape:data found) new-data)
|
||||
(if (eq force-insert :changed)
|
||||
(if (eql force-insert :changed)
|
||||
(insert track new-data)
|
||||
(update track new-data))))))
|
||||
|
||||
|
@ -112,10 +112,10 @@
|
|||
(destructuring-bind (f v &optional op) spec
|
||||
(unless v
|
||||
(setf v ""))
|
||||
(when (eq f :time-stamp)
|
||||
(when (eql f :time-stamp)
|
||||
(setf f :timestamp))
|
||||
(unless op
|
||||
(setf op (if (eq f :timestamp) :>= :=)))
|
||||
(setf op (if (eql f :timestamp) :>= :=)))
|
||||
(when (symbolp v)
|
||||
(setf v (string-downcase v)))
|
||||
(push (list op f v) crit)))
|
||||
|
|
|
@ -41,7 +41,9 @@
|
|||
(dom:a '(:href "https://example.com"
|
||||
:title "Demo" :class (:demo-link :plain))
|
||||
"Link to example.com"))
|
||||
"<a href=\"https://example.com\" title=\"Demo\" class=\"demo-link plain\">Link to example.com</a>"))
|
||||
(format nil
|
||||
"<a href=\"https://example.com\" title=\"Demo\" ~
|
||||
class=\"demo-link plain\">Link to example.com</a>")))
|
||||
|
||||
(deftest test-server-config (server)
|
||||
(== (parse-integer (server:port (core:config server))) 8899))
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
(put-char #\Space)
|
||||
(when val
|
||||
(put-string (string-downcase key))
|
||||
(when (not (eq val t))
|
||||
(unless (eql val t)
|
||||
(put-string "=\"")
|
||||
(put-string (attr-str key val))
|
||||
(put-char #\")))))
|
||||
|
|
Loading…
Add table
Reference in a new issue