Files
2025-03-13 13:59:07 -06:00

16 lines
427 B
EmacsLisp

;;; clj-lib.el -*- lexical-binding: t; -*-
(require 'dash)
(defmacro clj-condp (pred expr &rest clauses)
"TODO: Very unfinished."
(declare (indent defun))
(unless (symbolp pred)
(signal 'wrong-type-argument `(symbolp ,pred)))
(let ((expr* (gensym "expr")))
`(let ((,expr* ,expr))
(cond ,@(mapcar (lambda (x) `((,pred ,expr ,(car x)) ,(nth 1 x)))
clauses)))))
(provide 'clj-lib)