Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun update-post (post &key (title nil title-supplied-p)
- (path nil path-supplied-p))
- (let ((errors '()))
- (progn
- (when title-supplied-p
- (if (post-title-p title)
- (setf (slot-value post 'title) title)
- (setf errors (acons 'title "Invalid title" errors))))
- (when path-supplied-p
- (if (post-path-p path)
- (setf (slot-value post 'path) path)
- (setf errors (acons 'path "Invalid path" errors))))
- (if (equal errors '())
- (handler-case (mito:save-dao post)
- (t (c)
- (format t "Caught condition: ~A" c)
- (values nil '(( update_failure . "Persisting changes to DB failed")))))
- (values nil errors))
- (values t '()))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement