emacs-devel
[Top][All Lists]
Advanced

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

Re: combining cond and let, to replace pcase.


From: Daniel Semyonov
Subject: Re: combining cond and let, to replace pcase.
Date: Fri, 24 Nov 2023 05:26:02 +0200
User-agent: K-9 Mail for Android

Sorry, I sent the last mail as HTML by accident, here's a more readable version 
of the code:

(cond* (:bind foo bar (x foobar))
       ;; IMO changing t to ':always' would make it very clear what's
       ;; going on here.
       (t (match-set `(a ,foo ,bar) x))
       ((match-set `(b ,foo ,bar) x)
        ;; do stuff and exit
        )
       ;; more conditions...
       )

(cond* (:bind (x foobar))
       (:match (`(a ,foo ,bar) x))
       (:match (`(b ,foo ,bar) x)
               ;; do stuff and exit...
               )
       ;; more conditions...
       )



reply via email to

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