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

_______________________________________________
alexandria-devel mailing list
alexandria-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/alexandria-devel

Reply via email to