* Re: no empty (zero) string predicate in Elisp
[not found] ` <87wq107e40.fsf@petton.fr>
@ 2015-05-16 9:23 ` Nicolas Petton
2015-05-16 13:22 ` Bozhidar Batsov
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Nicolas Petton @ 2015-05-16 9:23 UTC (permalink / raw)
To: emacs-devel; +Cc: help-gnu-emacs, Emanuel Berg
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
Nicolas Petton writes:
> You can use `string-empty-p' from subr-x.el or `seq-empty-p' from
> seq.el (which works on all sequence data types).
>
> seq.el will be included in Emacs 25.1, but in the meantime you can
> install it from GNU Elpa.
BTW, would it be wise to obsolete `string-reverse' and `string-empty-p'
From subr-x in favor of `seq-reverse' and `seq-empty-p' which are much
more generic?
Nico
--
Nicolas Petton
http://nicolas-petton.fr
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: no empty (zero) string predicate in Elisp
2015-05-16 9:23 ` no empty (zero) string predicate in Elisp Nicolas Petton
@ 2015-05-16 13:22 ` Bozhidar Batsov
2015-05-16 13:28 ` Bozhidar Batsov
2015-05-16 13:43 ` Stefan Monnier
2015-05-16 15:27 ` Drew Adams
2 siblings, 1 reply; 8+ messages in thread
From: Bozhidar Batsov @ 2015-05-16 13:22 UTC (permalink / raw)
To: Nicolas Petton; +Cc: help-gnu-emacs, Emanuel Berg, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 683 bytes --]
I'd advise against this, as my intuition would always be to search for
something starting with `string-` when dealing with strings.
On 16 May 2015 at 12:23, Nicolas Petton <nicolas@petton.fr> wrote:
>
> Nicolas Petton writes:
>
> > You can use `string-empty-p' from subr-x.el or `seq-empty-p' from
> > seq.el (which works on all sequence data types).
> >
> > seq.el will be included in Emacs 25.1, but in the meantime you can
> > install it from GNU Elpa.
>
> BTW, would it be wise to obsolete `string-reverse' and `string-empty-p'
> From subr-x in favor of `seq-reverse' and `seq-empty-p' which are much
> more generic?
>
> Nico
> --
> Nicolas Petton
> http://nicolas-petton.fr
>
[-- Attachment #2: Type: text/html, Size: 1185 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: no empty (zero) string predicate in Elisp
2015-05-16 13:22 ` Bozhidar Batsov
@ 2015-05-16 13:28 ` Bozhidar Batsov
2015-05-16 13:36 ` Bozhidar Batsov
0 siblings, 1 reply; 8+ messages in thread
From: Bozhidar Batsov @ 2015-05-16 13:28 UTC (permalink / raw)
To: Nicolas Petton; +Cc: help-gnu-emacs, Emanuel Berg, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 843 bytes --]
Btw, `string-reverse` was already obsoleted by `reverse`.
On 16 May 2015 at 16:22, Bozhidar Batsov <bozhidar@batsov.com> wrote:
> I'd advise against this, as my intuition would always be to search for
> something starting with `string-` when dealing with strings.
>
> On 16 May 2015 at 12:23, Nicolas Petton <nicolas@petton.fr> wrote:
>
>>
>> Nicolas Petton writes:
>>
>> > You can use `string-empty-p' from subr-x.el or `seq-empty-p' from
>> > seq.el (which works on all sequence data types).
>> >
>> > seq.el will be included in Emacs 25.1, but in the meantime you can
>> > install it from GNU Elpa.
>>
>> BTW, would it be wise to obsolete `string-reverse' and `string-empty-p'
>> From subr-x in favor of `seq-reverse' and `seq-empty-p' which are much
>> more generic?
>>
>> Nico
>> --
>> Nicolas Petton
>> http://nicolas-petton.fr
>>
>
>
[-- Attachment #2: Type: text/html, Size: 1644 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: no empty (zero) string predicate in Elisp
2015-05-16 13:28 ` Bozhidar Batsov
@ 2015-05-16 13:36 ` Bozhidar Batsov
2015-05-16 13:46 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Bozhidar Batsov @ 2015-05-16 13:36 UTC (permalink / raw)
To: Nicolas Petton; +Cc: help-gnu-emacs, Emanuel Berg, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]
And one more thing - `string-empty-p` uses string comparison (`string=`)
instead of length comparison.
On 16 May 2015 at 16:28, Bozhidar Batsov <bozhidar@batsov.com> wrote:
> Btw, `string-reverse` was already obsoleted by `reverse`.
>
> On 16 May 2015 at 16:22, Bozhidar Batsov <bozhidar@batsov.com> wrote:
>
>> I'd advise against this, as my intuition would always be to search for
>> something starting with `string-` when dealing with strings.
>>
>> On 16 May 2015 at 12:23, Nicolas Petton <nicolas@petton.fr> wrote:
>>
>>>
>>> Nicolas Petton writes:
>>>
>>> > You can use `string-empty-p' from subr-x.el or `seq-empty-p' from
>>> > seq.el (which works on all sequence data types).
>>> >
>>> > seq.el will be included in Emacs 25.1, but in the meantime you can
>>> > install it from GNU Elpa.
>>>
>>> BTW, would it be wise to obsolete `string-reverse' and `string-empty-p'
>>> From subr-x in favor of `seq-reverse' and `seq-empty-p' which are much
>>> more generic?
>>>
>>> Nico
>>> --
>>> Nicolas Petton
>>> http://nicolas-petton.fr
>>>
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 2137 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: no empty (zero) string predicate in Elisp
2015-05-16 9:23 ` no empty (zero) string predicate in Elisp Nicolas Petton
2015-05-16 13:22 ` Bozhidar Batsov
@ 2015-05-16 13:43 ` Stefan Monnier
2015-05-16 15:27 ` Drew Adams
2 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2015-05-16 13:43 UTC (permalink / raw)
To: Nicolas Petton; +Cc: help-gnu-emacs, Emanuel Berg, emacs-devel
> BTW, would it be wise to obsolete `string-reverse' and `string-empty-p'
> From subr-x in favor of `seq-reverse' and `seq-empty-p' which are much
> more generic?
string-reverse i already marked as obsolete. As for string-empty-p, I'm
not sure, because it depends on whether you care about the fact that the
arg is a string (e.g. you care about the fact that (string-empty-p nil)
is nil rather than (seq-empty-p nil) being t).
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: no empty (zero) string predicate in Elisp
2015-05-16 13:36 ` Bozhidar Batsov
@ 2015-05-16 13:46 ` Eli Zaretskii
2015-05-16 16:17 ` Bozhidar Batsov
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-05-16 13:46 UTC (permalink / raw)
To: Bozhidar Batsov; +Cc: nicolas, embe8573, help-gnu-emacs, emacs-devel
> Date: Sat, 16 May 2015 16:36:18 +0300
> From: Bozhidar Batsov <bozhidar@batsov.com>
> Cc: help-gnu-emacs@gnu.org, Emanuel Berg <embe8573@student.uu.se>,
> emacs-devel <emacs-devel@gnu.org>
>
> And one more thing - `string-empty-p` uses string comparison (`string=`)
> instead of length comparison.
Are you saying that length comparison is better, or vice versa?
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: no empty (zero) string predicate in Elisp
2015-05-16 9:23 ` no empty (zero) string predicate in Elisp Nicolas Petton
2015-05-16 13:22 ` Bozhidar Batsov
2015-05-16 13:43 ` Stefan Monnier
@ 2015-05-16 15:27 ` Drew Adams
2 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2015-05-16 15:27 UTC (permalink / raw)
To: Nicolas Petton, emacs-devel; +Cc: help-gnu-emacs
C'mon guys, please don't cc both lists. (This belongs
in emacs-devel, IMHO, but please pick one list.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: no empty (zero) string predicate in Elisp
2015-05-16 13:46 ` Eli Zaretskii
@ 2015-05-16 16:17 ` Bozhidar Batsov
0 siblings, 0 replies; 8+ messages in thread
From: Bozhidar Batsov @ 2015-05-16 16:17 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Nicolas Petton, Emanuel Berg, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
On 16 May 2015 at 16:46, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sat, 16 May 2015 16:36:18 +0300
> > From: Bozhidar Batsov <bozhidar@batsov.com>
> > Cc: help-gnu-emacs@gnu.org, Emanuel Berg <embe8573@student.uu.se>,
> > emacs-devel <emacs-devel@gnu.org>
> >
> > And one more thing - `string-empty-p` uses string comparison (`string=`)
> > instead of length comparison.
>
> Are you saying that length comparison is better, or vice versa?
>
I'm saying that they are different. I prefer the string= comparison.
[-- Attachment #2: Type: text/html, Size: 1097 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-16 16:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87h9s4rhx5.fsf@debian.uxu>
[not found] ` <87wq107e40.fsf@petton.fr>
2015-05-16 9:23 ` no empty (zero) string predicate in Elisp Nicolas Petton
2015-05-16 13:22 ` Bozhidar Batsov
2015-05-16 13:28 ` Bozhidar Batsov
2015-05-16 13:36 ` Bozhidar Batsov
2015-05-16 13:46 ` Eli Zaretskii
2015-05-16 16:17 ` Bozhidar Batsov
2015-05-16 13:43 ` Stefan Monnier
2015-05-16 15:27 ` Drew Adams
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).