emacs-devel
[Top][All Lists]
Advanced

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

Re: pcase-dolist


From: Stefan Monnier
Subject: Re: pcase-dolist
Date: Wed, 08 Jul 2015 17:27:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>   (pcase-let ((`(,w ,x ,y ,z) '(1 2 3)))
>     (message "%s %s %s %s" w x y z))

> prints "1 2 3 nil" although the pattern when used in `pcase' wouldn't
> match that list but only 4-element lists.  So a pcase pattern has
> different semantics depending on whether it is used in `pcase' or
> `pcase-let' or `pcase-dolist' which doesn't feel right.

> I'd prefer if `pcase-let' would signal an error if some pattern doesn't
> match.

So you'd want the above to signal an error in the case of:

   (pcase-let ((`(,w ,x) '(1 2 3)))
     (message "%s %s" w x))

?


        Stefan



reply via email to

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