emacs-devel
[Top][All Lists]
Advanced

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

Re: Imports / inclusion of s.el into Emacs


From: João Távora
Subject: Re: Imports / inclusion of s.el into Emacs
Date: Sun, 3 May 2020 13:21:35 +0100

On Sun, May 3, 2020 at 11:06 AM Philippe Vaucher
<address@hidden> wrote:
>
> > Can you make a top-ten?
>
> Aliases:
>
> split-string aliased as string-split
> downcase aliased as string-downcase
> upcase aliased as string-upcase
> format aliased as string-format
> concat aliased as string-concat

Don't do this.  Just learn these 5 names, or use apropos, as
has been suggested.  Though curiously, downcase is
string-downcase in CL, but that only really does work for
strings.

(BTW, a tangent, what do you think of CL's hyperspec reference?

Check out

http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm

and

http://www.lispworks.com/documentation/HyperSpec/Body/c_string.htm

Do you think this organization would be useful? What if it had a cool
font and some cool logos? :-)  I ask because that put me off at first, it
looked mouldy.)

> New functions (with string- instead of s-):
>
> s-truncate (len s)

truncate-string-to-width (I got there with apropos truncate.*string btw).

> s-chomp (s)

Let's make a 'chomp' function.  I'm always looking for that. Though there
is a string-trim already (sigh).

> s-left (len s)

subseq

> s-right (len s)

Add an "from-end" arg to subseq?

> s-repeat (num s)

(cl-loop repeat num concat s)

> s-capitalize (s)

capitalize,  also works for chars.

> s-reverse (s)

reverse, also works for sequences

> s-contains-p (needle s &optional ignore-case)

string-match-p

> s-blank-p (s)

ugh. nil is a string?

Hope it helps,
João



reply via email to

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