Re: Multiple arguments to mapcar?
- From: "Steven M. Haflich" <smh@xxxxxxxxxxxx>
- Date: Tue, 06 Nov 2007 09:49:44 GMT
Pascal: Here's a neat example of using of loop to solve a well-understood problem in a nonobvious way...
(defun primes-below-limit (limit)
(cons 2
(loop for i from 3 by 2 below limit
unless (loop for p in primes
when (integerp (/ i p)) return t)
collect i into primes
finally (return primes))))
I think this is portable and correct, provided limit >= 2.
.
- Follow-Ups:
- Re: Multiple arguments to mapcar?
- From: Pascal Costanza
- Re: Multiple arguments to mapcar?
- References:
- Multiple arguments to mapcar?
- From: Johan
- Re: Multiple arguments to mapcar?
- From: Pascal Costanza
- Multiple arguments to mapcar?
- Prev by Date: Re: (cached) named return values?
- Next by Date: Re: Already-written code for printing small trees?
- Previous by thread: Re: Multiple arguments to mapcar?
- Next by thread: Re: Multiple arguments to mapcar?
- Index(es):
Relevant Pages
|