2022-05-24 19:22:00 -04:00
|
|
|
(defmacro inc (x &optional (val 1))
|
|
|
|
`(setf ,x (+ ,val ,x)))
|
|
|
|
|
|
|
|
;; For system arguments
|
|
|
|
(defmacro when-option ((options opt) &body body)
|
|
|
|
`(let ((it (getf ,options ,opt)))
|
|
|
|
(when it
|
|
|
|
,@body)))
|
2022-05-30 00:31:48 -04:00
|
|
|
|
|
|
|
(defun max-length (lists)
|
|
|
|
(reduce (lambda (a x) (max a x)) (mapcar #'length lists)))
|
2022-05-31 17:56:24 -04:00
|
|
|
|
2022-06-04 16:09:39 -04:00
|
|
|
(defun nonempty-p (s)
|
2022-06-01 02:23:58 -04:00
|
|
|
(not (zerop (length s))))
|