[Top][All Lists]

[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 12:56:26 +0100

On Sun, May 3, 2020 at 11:55 AM Stefan Kangas <address@hidden> wrote:
> Philippe Vaucher <address@hidden> writes:
> > Aliases:
> >
> > split-string aliased as string-split
> This is a better name.  FWIW, I think the old one should be deprecated too.

People coming from Common Lisp and not Clojure will find 'split-string'
more appropriate.

Now really, I don't think this "prefix with the type name" makes
any sense.  When I learned Lisp coming from Java, it bothered me,
yes. But I got over it, quickly. Functions in lisp are generic, or at least
duck-typed. If in Haskell or Ruby the name of the operated-on type
always  matches the namespace qualifier, good for them I guess. I know
0 Haskell, but last I checked those Ruby functions aren't top-level
functions, they're methods on a String object. So that just reflects a
different way to look at OO.  I often use it when in those languages, but
in Lisp there's a different take to it.  So the namespace qualifier doesn't
necessarily bear any direct relation to type of the object being operated
on [1]. Sometimes it does, yes, but it's accidental. Shoving this foreign
convention down Lisp's throat is cruel. And ignorant, sorry. (ignorance
isn't a defect, it's a default). The point of doing it, I suppose, is that it
would bring in lots of newcomers onboard. But shouldn't we rather be
welcoming them by efficiently showing them them the joys of
Javalessness instead?  Do we need a manual with pretty pictures
and fancy fonts? Let's do it then.

OK, ranting over. In CL-land, there is the very good split-sequence[3],
which is a generalized split-string (and compatible with the "split the
empty string" case). I propose we get that instead.  If we're lucky, that
CL code is directly translatable to Elisp (seems to be from a cursory
inspection). Yeah call it seq-split if you really must drink the kool-aid.

[1]: The lack of a package system in Elisp (not package.el, mind you
that's a different thing) adds to the confusion, but it's really the same.
[2]: http://quickdocs.org/split-sequence/


reply via email to

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