help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Partition for Emacs Lisp


From: Xah Lee
Subject: Re: Partition for Emacs Lisp
Date: Sun, 28 Jun 2009 10:53:19 -0700 (PDT)
User-agent: G2/1.0

On Jun 28, 6:26 am, Marc Tfardy <b...@cyk.cyk> wrote:
> Hi!
>
> I looking for a ELISP function that do the job like Partition in
> Mathematica. The simplest case:
>
> (partition '(a b c d e f) 2)
>
> should return:
> ((a b) (c d) (e f))
>
> Is there something ready out from the box?
>
> In more sophisticated cases one can define overlap with offset and much
> more interesting things - look 
> at:http://documents.wolfram.com/mathematica/functions/Partition

there's no such function. You have to write it yourself.

my experiences with lisps from Mathematica is that, most basic list
processing functions in Mathematica does not exist in lisp, and in
general, there's no coherent libraries to use either. Everyone just
write it from scratch. (it's not easy to write them either, due to the
cons business)

things like Partition, Flatten, Part, Level, etc gets asked every
maybe 3 months for example in comp.lang.lisp over the past decade, and
the answers are always wild.

might be of interest:

• Xah Lee's Computing Experience Bio
  http://xahlee.org/PageTwo_dir/Personal_dir/xah_comp_exp.html

• Fundamental Problems of Lisp
  http://xahlee.org/UnixResource_dir/writ/lisp_problems.html

the first one is some of my experience from Mathematica to lisp. The
second one is about the cons business, and the shock that lisp doesn't
do list procesing well.

  Xah
∑ http://xahlee.org/

reply via email to

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