[Top][All Lists]

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

Re: no empty (zero) string predicate in Elisp

From: Rusi
Subject: Re: no empty (zero) string predicate in Elisp
Date: Sun, 26 Apr 2015 10:28:14 -0700 (PDT)
User-agent: G2/1.0

On Sunday, April 26, 2015 at 6:01:15 PM UTC+5:30, Emanuel Berg wrote:
> 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

Rather befuddled here...
Do you want or not want empty-string-p??

Your first post said you've defined it and you want it not in ELPA but emacs.
Now you are saying you want a binary -- presumably (== "" whatever).

reply via email to

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