There was a recent suggestion here: http://groups.google.com/group/clojure/msg/32d323e15f8ce624
about the proper value of: (clojure.contrib.lazy-seqs/combinations)(and perhaps by extension (clojure.contrib.lazy-seqs/combinations '()) (or any number of empty seq arguments))
Does a decision to use empty collections in the powerset case fit well with the suggestion that
(clojure.contrib.lazy-seqs/combinations) return ([]) or are they in conflict or unrelated? --Steve On Jan 23, 2009, at 7:20 AM, lpetit wrote:
+1. #{} is the empty set, () is the empty list, {} is the empty map. Cheers, -- Laurent On 23 jan, 10:17, Konrad Hinsen <konrad.hin...@laposte.net> wrote:On 23.01.2009, at 09:35, Mark Engelberg wrote:Now, here's the puzzle. Let's say you want to convert this idea overto working with lists, or perhaps sequences in general.Should (powerset '(1 2 3)) print as: (() (1) (2) (3) (1 2) (1 3) (2 3) (1 2 3)) or (nil (1) (2) (3) (1 2) (1 3) (2 3) (1 2 3))My vote is for (), because it specifically represents the empty subset of a list, rather than a generic "nothing in here" value, which is my interpretation of nil.between lists and sequences and the role of nil and the empty list, soI look forward to hearing the responses. Let the debating begin!This reminds me of the long debates in the APL community about the shapes of empty nested arrays :-) Konrad.--~--~---------~--~----~------------~-------~--~----~You received this message because you are subscribed to the Google Groups "Clojure" group.To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature