Fundamental Problems of Lisp — Prelude

By Xah Lee. Date:

Prelude

Joost Kremers wrote, in comp.lang.lisp:

basically, what i want to do is to take a list of the form (a b c d e f) and transform it into a list of the form ((a b) (c d) (e f)). i've come up with a do-loop that does this, but i have this feeling there must be a better way…

Xah Lee wrote:

In Mathematica, you can just partition it first. e.g.

mylist = {1, 2, 3, 4, 5, 6};

Map[First@# &, Partition[mylist, 2]]

returns {1,3,5}

In FullForm (i.e. lispy form but without lisp's irregularities like “'#;” stuff), each of the above is:

Set[mylist, List[1,2,3,4,5]]
Map[Function[First[Slot[1]]], Partition[mylist, 2]]

In langs without partition, the basic approach is using mod n. (in our case, n is 2, so just evenp or oddp)

For elisp, which doesn't have a construct to get the index of element (and no “for” construct), it's a bit more tedious.

tedious, tedium, problematic. Scheme lisp would be like that. In the case of Common Lisp, there are easy ways as others are eager to show but extreme complexity arise.

Joost Kremers wrote:

which, however, is not what i was interested in…

Of course. I know.

I post to fck with the Common Lisp fckheads that slave here.

Why? Because, since i'm heavily interested in functional programing, in lisp, often i see well known problems in Lisp yet that could be fixed yet the regular Common Lisping old hats shut out any possible improvement the moment they see it. (note to readers: i'm not just interested in functional programing, i'm the world's top expert, far beyond the common lisp fckheads here that has some 10 years of experience programing in CL.)

As you can see in this thread, a simple, truely trivial problem, practically trivial in the most basic sense of that word, as exhibited in the solution in Mathematica, took a lot Common Lisper discussions about it. This happens very frequently here, most painful to the mind because a lot of the problem is pure problems on list manipulation. (suppose that LISP stands for LISt Processing. FCK cons, fck you car and cdr, and mostly, fck you Common Lispers because if you didn't not die these problems'd fixed long ago.)

I myself am particular pissed because i have strong practical interest in emacs lisp. Am doing increasingly more code in elisp. The fundamental problems that could be easily fixed technically but not fixed, pisses me off. Of course no lang can be perfect… but many obvious fixable problems i constantly see the Lisper regulars here kill any seed for improvement of the situation.

Sure… you or other might start to argue blab blab, blab blab, about being opinions or whatnot. I've read 10 years of comp.lang.lisp. I've seen, practically speaking, it all.

I'm beginning to realize, the situation is actually a common pattern in human social groups. I haven't exactly narrowed down on a name or something, but basically when a human group is established for a while, its political structures may resist improvements that call for change. Possibly, from a political science's point of view, the reason is that the change harms the identity or integrity of the group.

Patreon me $5. Ask me question on patreon