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

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

pcase and minus-sign


From: Andreas Röhler
Subject: pcase and minus-sign
Date: Wed, 30 Nov 2016 13:12:23 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0

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





reply via email to

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