[alexandria-devel] length=1

Andreas Fuchs asf at boinkor.net
Fri Feb 22 12:19:54 UTC 2008


On Feb 22, 2008, at 12:30, Nikodemus Siivola wrote:
> How about LENGTH= ?
>
> ;; stupid version
> (defun length= (n seq)
>  (= n (length seq)))

I think the idea is to have something you can use as an argument to  
functions like find-if. My own solution when I wanted that was  
functions returning closures:

(defun length= (n) (lambda (seq) (= n (length seq))))

Which lets me do (find-if (length= 1) some-sequence)

Cheers,
-- 
Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs




More information about the alexandria-devel mailing list