[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Imports / inclusion of s.el into Emacs
From: |
Dmitry Gutov |
Subject: |
Re: Imports / inclusion of s.el into Emacs |
Date: |
Fri, 1 May 2020 21:47:26 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 01.05.2020 21:05, Philippe Vaucher wrote:
I'll try to explain my side first so you see where I'm coming from. So,
I guess a lot of s.el users think it's a massive improvement over what
emacs has to offer reguarding string manipulations. This is visible in
issues like https://github.com/magnars/s.el/issues/88.
I imagine this impression might come purely from seeing a set of these
functions collected in one place. And not necessarily from including all
the helpers as well.
I never coded
with clojure, but my argument for these helpers is that in code we do
string manipulations all the time, they are trivial to write, so why not
have trivial helpers.
The criticism would be exactly the same: if they're trivial, why have
them in the library at all.
I understand there's a limit to such helpers
because you could write thousands of them, so good taste should be used
to introduce "the minimal set".
Exactly. We do have some of them in subr-x already. We can add some
more, though I'd only pick the non-trivial ones, among those that are
likely to be used.
I usually don't care about these extra
function calls, what matters more to me is how beautiful the code looks
and how readable it is.
Often, I'd agree. But the tradeoffs when creating the standard library
of the language are somewhat different, IMHO.
Because string manipulation is so trivial, I'd like them to be
grouped together so they are easy to find. In other languages I can
usually go to one page and have the list of all strings related
functions. In Emacs the manual at
https://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Characters.html while
helpful makes it hard to "read it all" and find what you are looking
for. For example I couldn't find concat on that page.
I fully support your criticism here. The old-timers will tell you to use
the manual (from Emacs), but we both know that a lot of user are still
much more likely to resort to a web search, and there the manual is not
so great (no index, at the very least).
From your side, I understand that your definition of the minimal set is
much thiner, and maybe what would help is to give the complete list of
the functions you find superfluous and why (list at
https://github.com/magnars/s.el so far you mention `s-prepend` and
`s-append`). For example I'd disagree if you said `s-left` and `s-right`
are not useful to import because it can be done with `substring`.
I will respectfully refuse this invitation: I have other work to do.
As for 'concat' being hard to find: adding a 'string-concat' alias
(without any plans to remove the original) could satisfy both sides, maybe.
- Re: Imports / inclusion of s.el into Emacs, (continued)
- Re: Imports / inclusion of s.el into Emacs, Stefan Monnier, 2020/05/02
- Re: Imports / inclusion of s.el into Emacs, Lars Ingebrigtsen, 2020/05/03
- Re: Imports / inclusion of s.el into Emacs, Richard Stallman, 2020/05/02
- Re: Imports / inclusion of s.el into Emacs, Phillip Lord, 2020/05/05
- Re: Imports / inclusion of s.el into Emacs, João Távora, 2020/05/05
- Re: Imports / inclusion of s.el into Emacs, Stefan Monnier, 2020/05/05
Re: Imports / inclusion of s.el into Emacs, Philippe Vaucher, 2020/05/01
Re: Imports / inclusion of s.el into Emacs, Philippe Vaucher, 2020/05/01
Re: Imports / inclusion of s.el into Emacs, Richard Stallman, 2020/05/02
Re: Imports / inclusion of s.el into Emacs, Philippe Vaucher, 2020/05/03
Re: Imports / inclusion of s.el into Emacs, Richard Stallman, 2020/05/03
Re: Imports / inclusion of s.el into Emacs, Phillip Lord, 2020/05/06
Re: Imports / inclusion of s.el into Emacs, Richard Stallman, 2020/05/01