documentation of clojure.set/difference

21 views
Skip to first unread message

Sunil S Nandihalli

unread,
Dec 1, 2010, 3:11:42 AM12/1/10
to clo...@googlegroups.com
Hello everybody,
 I think the documentation of the clojure.set/difference should change to reflect the fact that only the first argument needs to be a set and the rest of the arguments can be any collection.
 I am reporting this from Clojure 1.2

Sunil.

Stuart Halloway

unread,
Dec 1, 2010, 10:24:57 AM12/1/10
to clo...@googlegroups.com
The documentation is correct. It tells what the function promises to callers, not how it does it.

Rely on implementation details at you peril. :-)

Stu

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Sunil S Nandihalli

unread,
Dec 2, 2010, 2:45:31 AM12/2/10
to clo...@googlegroups.com
Thanks Stu .. 
 
But I think it may be reasonable to say that the rest of the arguments can be any collection and not just Set .. But I guess you have your reasons .. I will assume that every argument is just a set and not anything else.

Sunil.

Paul Mooser

unread,
Dec 2, 2010, 8:18:08 PM12/2/10
to Clojure
I haven't looked at the implementation, but presumably it's
"modifying" one collection, and iterating over the other. If you rely
on the documentation, that gives the implementors the freedom to do
something like swap which collection is iterated over, based on the
size (ie, if your operation is linear in the size of one of your sets,
you might want to iterate over the smaller one).

On Dec 1, 11:45 pm, Sunil S Nandihalli <sunil.nandiha...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages