bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20784: 25.0.50; pcase documentation on t and nil


From: Michael Heerdegen
Subject: bug#20784: 25.0.50; pcase documentation on t and nil
Date: Fri, 12 Jun 2015 19:31:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <monnier@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.





reply via email to

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