all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* pcase and minus-sign
@ 2016-11-30 12:12 Andreas Röhler
  2016-11-30 12:38 ` Joost Kremers
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Röhler @ 2016-11-30 12:12 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi,

see code below. With numerical argument "1", first pattern is matched as 
expected.

However without arg the minus is matched - the second pattern, not the 
default "_" at last.

Any explanation?

Thanks,

Andreas


(defun foo (arg)
   (interactive "P")
   (pcase arg
     (1 (message "%s" "ARG was `1'"))
     (- (message "%s" "ARG was minus-sign"))
     (_ (message "%s" "ARG not minus-sign"))))

;; GNU Emacs 25.1.90.1 (i686-pc-linux-gnu, GTK+ Version 3.14.5) of 
2016-11-29





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-12-05  9:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 12:12 pcase and minus-sign Andreas Röhler
2016-11-30 12:38 ` Joost Kremers
2016-11-30 13:30   ` Andreas Röhler
2016-11-30 13:31     ` Michael Heerdegen
2016-11-30 13:39     ` tomas
2016-11-30 13:56     ` Joost Kremers
2016-11-30 15:23       ` Andreas Röhler
2016-11-30 15:34         ` Michael Heerdegen
2016-11-30 15:48         ` Joost Kremers
2016-12-01 13:59           ` Andreas Röhler
2016-12-02  2:30             ` Stefan Monnier
2016-12-03  8:04               ` Andreas Röhler
2016-12-03 15:43                 ` Stefan Monnier
2016-12-05  9:11                   ` Andreas Röhler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.