[Small-cl-src] Re: Small, occasionally handy piece of code

Steven E. Harris seharris at raytheon.com
Fri Jul 9 16:18:39 UTC 2004


Ingvar <ingvar at cathouse.bofh.se> writes:

> Haven't we all felt the need of generating combinations from a
> collection and calling a function for every combination?

I wrote one a while ago that may cons less because it requires use of
vectors to represent the sequences. The interface to
call-with-combinations is similar to yours, with the argument order
mixed up.

There's a lower-level function call-with-n-combo-slots that is useful
when one has both the source and working "target" vectors in hand. The
target vector is used to present the caller-provided function with the
current combination, similar to your "acc" argument.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: combinations.lisp
URL: <https://mailman.common-lisp.net/pipermail/small-cl-src/attachments/20040709/ee0d66ab/attachment.ksh>
-------------- next part --------------

-- 
Steven E. Harris        :: seharris at raytheon.com
Raytheon                :: http://www.raytheon.com


More information about the Small-cl-src mailing list