emacs-devel
[Top][All Lists]
Advanced

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

Re: string> missing?


From: Thibaut Verron
Subject: Re: string> missing?
Date: Wed, 3 Jun 2015 21:36:05 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Nick Andryshak <nandryshak <at> gmail.com> writes:


> Having one comparison operator without the other is simply confusing to
> developers. If I'm writing code where '<' exists and works, I believe
> it's reasonable for me to assume that '>' will also. Apply this same
> logic to string< and string>.
> 

I did run into a similar issue not long ago, when I had to test for emacs 
version in my .emacs. It took me a few minutes to find out that no, 
version> doesn't exist. It left me with a bitter taste of waste, like some 
simplicity that was given up for no apparent reason. 

But I could see a possible reason for this missing function: version> and 
version< are not as symmetrical as they would seem, and writing code "for 
all emacs versions more recent than this one" is almost certainly going to 
break something in the future.

What is understandable for version> seems to be nonsense for string> 
though. In this case, the functions are symmetrical, why have one and not 
the other?

And about the additional string<= and string>=, I'd say these are even 
more useful, because testing strings for equality in emacs lisp is already 
tricky enough! And, it is possible to test if a string is less than or 
equal to another faster than the combination of both tests.

Thibaut




reply via email to

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