Bugs in clojure.contrib.combinatorics/cartesian-product (and others?) with false/nil values

11 views
Skip to first unread message

Jason Wolfe

unread,
Sep 23, 2010, 7:21:42 PM9/23/10
to Clojure Dev
Along the same lines as my last message

user> (cartesian-product [1 2] [true false] )
((1 true) (1 false) (2 true) (2 false))
user> (cartesian-product [1 2] [false true])
nil
user> (cartesian-product [1 2] [nil 4])
nil

false/nil in first position seems to cause failure. Ticket?

Mark Engelberg

unread,
Sep 23, 2010, 7:35:48 PM9/23/10
to cloju...@googlegroups.com
Good catch. The fix is simple:
Line 123 should change from:
(when (every? first seqs)
to:
(when (every? seq seqs)

I'm still a bit muddled when it comes to git, and it would probably
take me a while to figure out how to push this change. If anyone else
wants to apply the fix, that would be a huge time-saver.

Thanks,

Mark

> --
> You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
> To post to this group, send email to cloju...@googlegroups.com.
> To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.
>
>

Stuart Sierra

unread,
Sep 24, 2010, 3:03:55 PM9/24/10
to Clojure Dev

Mark Engelberg

unread,
Sep 24, 2010, 7:13:18 PM9/24/10
to cloju...@googlegroups.com
On Fri, Sep 24, 2010 at 12:03 PM, Stuart Sierra
<the.stua...@gmail.com> wrote:
> Ticket created:
>
> http://www.assembla.com/spaces/clojure-contrib/tickets/96-cartesian-product-with-nil-args
>
> Fix applied.
> -S

Thanks!

Reply all
Reply to author
Forward
0 new messages