William James
10/29/2015 9:04:00 AM
WJ wrote:
> > (defun partition (list &aux (pivot-value (first list)))
> > (loop for item in list
> > if (< item pivot-value)
> > collect item into less
> > else
> > collect item into greater-or-equal
> > finally (return (values less greater-or-equal))))
> >
> > Never underestimate the power of LOOP :)
>
> Gauche Scheme:
>
> gosh> (partition odd? '(2 0 9 4 3 6))
> (9 3)
> (2 0 4 6)
MatzLisp (Ruby):
[2,0,9,4,3,6].partition &:odd?
==>[[9, 3], [2, 0, 4, 6]]
--
Let us be brought to believe it is ... favorable to ... our interest to
transfer the African to his native clime, and we shall find a way to do it,
however great the task may be. --- A. Lincoln, Sept. 22, 1856