if-cdr-notnull   macro


Defined in:  https://github.com/lambdamusic/extempore-extensions/blob/main/init/init_lisp.xtm

Implementation

;;
;; if the cdr of the list-condition exists, then proceed / else alternative
;;
;; example
; (if-cdr-notnull '(a)
;   (log-info 'good-cdr)
;   (log-info 'bad-cdr))  ;; => true
;;
(define-macro (if-cdr-notnull list1 args . elseargs)
   `(if (not (null? (cdr ,list1)))
        ,args
        ,@elseargs))


Back to Index