Re: newbie question
- From: "Coby Beck" <cbeck@xxxxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 21:44:39 GMT
"dvlfrnd" <iresjen@xxxxxxxxx> wrote in message
news:1136059463.523048.214540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> but couldn't find a way to apply it to the entire list.
> i tried a recursive function,but it didnt give the output i wanted.
Here is a recursive solution to add to the loops:
(defun divide-in-pairs (list)
(cond ((not (listp list)) (error "non-list argument"))
((null list) nil)
((null (cdr list)) (error "odd number of elements"))
((null (cddr list)) (list list))
(t (cons (list (first list) (second list))
(divide-in-pairs (cddr list))))))
--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
.
- References:
- newbie question
- From: dvlfrnd
- newbie question
- Prev by Date: Re: newbie question
- Next by Date: Re: newbie question
- Previous by thread: Re: newbie question
- Next by thread: Re: newbie question
- Index(es):
Relevant Pages
|