emacs-devel
[Top][All Lists]
Advanced

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

RE: One more string functions change


From: Drew Adams
Subject: RE: One more string functions change
Date: Fri, 27 Jun 2014 15:46:33 -0700 (PDT)

> (defun gnus-string< (s1 s2)
>    "..."
>    (if case-fold-search
>        (string-lessp (downcase (if (symbolp s1) (symbol-name s1) s1))
>                      (downcase (if (symbolp s2) (symbol-name s2) s2)))
>      (string-lessp s1 s2)))

Why?  Is (string-lessp s1 s2 t) really that much handier than being
explicit?

(let ((case-fold-search  t)) (string-lessp s1 s2))

or

(string-lessp (upper s1) (upper s2))

We already have a global variable for this.  Why add an argument for it?

And if you want to accept symbols too as args, then "string-lessp" is
anyway a poor name for what it does.

This is no different from lots of other uses of a function that binds
a global var, or converts/casts its args, to change its behavior.

How many occurrences of such a programming cliche for `string-lessp'
do you find in the Emacs sources, for example?  One?  Zero?

YAGNI.



reply via email to

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