emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] seq-let c856843: New macro seq-let, providing destruct


From: Stefan Monnier
Subject: Re: [Emacs-diffs] seq-let c856843: New macro seq-let, providing destructuring support to seq.el
Date: Sat, 02 May 2015 03:07:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> I see, it would indeed makes sense to have it.  I'll have a look at how
> pcase works internally and how patterns can be defined.

grep for pcase-defmacro: that should give you a good starting point.

> I think having both would make sense though as `seq-let' is IMO simpler
> to use.  Maybe one could reuse code from the other.

I don't think the `seq' pcase pattern can be defined using seq-let, but
seq-let could easily be defined as a wrapper that expands to a pcase-let.

BTW, another advantage of defining a pcase pattern is that you could then
also do things like

   (pcase-dolist ((seq a b c) my-things)
     ...)


-- Stefan



reply via email to

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