GNU bug report logs - #20784
25.0.50; pcase documentation on t and nil

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Wed, 10 Jun 2015 20:21:02 UTC

Severity: minor

Tags: fixed

Found in version 25.0.50

Fixed in version 25.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 20784 <at> debbugs.gnu.org, Artur Malabarba <bruce.connor.am <at> gmail.com>
Subject: bug#20784: 25.0.50; pcase documentation on t and nil
Date: Fri, 12 Jun 2015 19:31:10 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> We currently don't have a special "fail" pattern which simply never
> matches.  Of course, you can make one up (e.g. (guard nil)).

(or) would also do it, but raises (error "Please avoid it")  (BTW
(or _) raises that error, too).  Why are those (error "Please avoid it")
calls useful?

> I think making nil such a pattern would probably lead to more
> errors/confusion than anything, since it's extremely rare to need such
> a pattern.

Agreed.

> That's pretty much what SELFQUOTING is.  IF you think renaming it to
> ATOM would help, then we could do that.

I would prefer that over SELFQUOTING because

  SELFQUOTING	is a shorthand for 'SELFQUOTING.

sounds like a tautology.

> As explained the use of `eq' is supposed to be a pure optimization with
> no semantics effect.

I see.  Then I guess it would make sense to merge these two lines in the
` doc?

  STRING                matches if the object is ‘equal’ to STRING.
  ATOM                  matches if the object is ‘eq’ to ATOM.

into

  ATOM                  matches if the object is ‘equal’ to ATOM.


Regards,

Michael.




This bug report was last modified 8 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.