emacs-devel
[Top][All Lists]
Advanced

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

Re: Unary /


From: Paul Eggert
Subject: Re: Unary /
Date: Thu, 15 Oct 2015 12:20:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 10/15/2015 11:45 AM, Stefan Monnier wrote:
Indeed, the - has the same asymmetry, but it seems that "unary -" is  much
more commonly found operator than "unary /".

I suspect David was being ironic....

Unary / is rare in Elisp code, partly because the GNU Emacs byte compiler complains about it, partly because it doesn't work in GNU Emacs 24.2 and earlier, partly because it has the Common Lisp semantics in XEmacs, and partly because one doesn't often need the reciprocal of a floating-point number. With all that being said, it's a bit more useful for (/ N) to return the reciprocal of N than to return N, so we might as well be compatible with CL here.

I've proposed a patch to change unary / to behave more like CL, in Bug#21690. Since we're in feature-freeze now isn't a good time to be changing the semantics of /, but there's no rush. In the meantime we can leave the byte-compiler alone, as its bogus warning about (/ N) will help scare users away from the soon-to-be-withdrawn semantics.



reply via email to

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