emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another pcase-lambda


From: Michael Heerdegen
Subject: Re: Another pcase-lambda
Date: Thu, 21 Sep 2017 13:40:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)

Mark Oteiza <address@hidden> writes:

> (defmacro case-lambda (&rest spec)
>   "Return an arbitrary arity function."
>   (declare (indent 0) (debug (&rest (pcase-QPAT body))))
>   (let ((args (make-symbol "args")))
>    `(lambda (&rest ,args)
>       (pcase-exhaustive ,args ,@spec))))

I think I would prefer to spell it out and use the expanded form
instead.  It's nice, but I'm not convinced it would be worth adding.

OTOH, as an occasional user of `pcase-lambda' I know that it's a bit
cumbersome to use.  But `case-lambda' defers all calculation into the
argument list - I'm not sure if this is so useful all the time.

BTW, what I sometimes do miss is `pcase-defun'.


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]