From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: no empty (zero) string predicate in Elisp Date: Sun, 26 Apr 2015 14:36:01 +0200 Organization: Aioe.org NNTP Server Message-ID: <87wq0zkqxa.fsf@debian.uxu> References: <87h9s4rhx5.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430051722 6999 80.91.229.3 (26 Apr 2015 12:35:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Apr 2015 12:35:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 26 14:35:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YmLmH-0003Kv-Tm for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Apr 2015 14:35:18 +0200 Original-Received: from localhost ([::1]:50689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmLmG-0008Du-IB for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Apr 2015 08:35:16 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:PmBdF9nELZ5Bbsk18wilR6IyJ5w= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:211720 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104002 Archived-At: Stefan Monnier writes: > I do wonder, why you'd rather write (empty-string-p > foo) instead of (equal "" foo) or (string= "" foo) > ... It's longer I don't mind typing. It is one of my favorite activities (in very stiff competition), especially when it only involves common words with chars that are close and super-fast to type: 'empty-string-p' is definitely more pleasant to type (and read) than 'string= ""' whereas 'equal ""' should be about "equally" pleasant to type, but still less so to read. > slower If that is true, which I suppose it is because it requires an extra function call, the difference should be close to infinitely small. I don't consider such quantities. Actually, I don't consider speed at all when I write Elisp. (But I never did any one big project that could gain from optimization, either. Still, I don't think I write slow code, in general.) When I told the other guy the other day that (make-string 10 ? ) is better than `dotimes' and (insert " ") 10 times, there I focus on the code rather than the speed - but those two (?) ways of thinking should work to each other's advantage most often. > not higher-level either I don't know the scientific definition of "high-level" - or how it applies to these three Elisp functions. The reason I want a binary operator is that it is more intuitive: it refects my way of thinking - "is the string empty?" vs. "is the string equal to another string that is empty?" - also, because a binary operator reduces the number of data items in the code (with one, the empty string). In general, I don't want the same function to be spelled out over and over to do the same thing - instead, I want it factored out, named, and invoked with a "minimal", that is, sufficient, interface. -- underground experts united http://user.it.uu.se/~embe8573