diff options
Diffstat (limited to 'src/core.lisp')
| -rw-r--r-- | src/core.lisp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core.lisp b/src/core.lisp index 4f88e5b..3f217c5 100644 --- a/src/core.lisp +++ b/src/core.lisp @@ -4,7 +4,7 @@ (defpackage :org-ckons-core (:use :cl :cl-log)) -(in-package #:org-ckons-core) +(in-package :org-ckons-core) (require :sb-introspect) @@ -48,10 +48,6 @@ string representation of\)." (with-input-from-string (stream my-string) (read stream))) -(defmacro add-to-list (output-list &rest value-to-add) - "Wraps the SETF...APPEND idiom in a smaller package." - `(setf ,output-list (append ,output-list ,@value-to-add))) - (defun parse-symbol (my-symbol) (let ((symbol-parts (ppcre:split "::" (symbol-name my-symbol)))) (if (= (length symbol-parts) 1) @@ -95,7 +91,11 @@ SBCL." (mapcar 'sb-mop:slot-definition-name (sb-mop:class-slots (class-of instance)))) (defun null-or-empty-p (sequence) - (or (null sequence) (equal (length sequence) 0))) + (handler-case + (equal (length sequence) 0) + (error (e) + (declare (ignore e)) + t))) (defun xml-escape (mystring) (setf mystring (ppcre:regex-replace-all "<" mystring "<")) @@ -202,3 +202,6 @@ list of `cl-smtp:attachment' objects if non-nil." ,@(when html-message `(:html-message ,html-message)) ,@(when authentication `(:authentication ,authentication)) ,@(when attachments `(:attachments ,attachments)))) + +(defun parse-slot (slot) + (first (last (ppcre:split "::" (symbol-name slot))))) |
