A set is, in a sense, a function mapping from arbitrary objects to Boolean values. If the object is in the set, it returns true. A list, in the Lisp world at least, only has two elements, first and rest (car and cdr in older Lisps). A list object isn't really a "complete" collection the way vectors and maps are. There isn't a good way to conceptualize that as a function.
I've probably just made this more confusing, but that's the best I could come up with. -Stuart Sierra On Jan 12, 6:51 pm, Ethan Herdrick <herdr...@gmail.com> wrote: > Then why are sets callable? Not that I'm complaining - I found it > handy, then came to wonder why lists aren't. > > -Ethan > > > I'd just like to add to this discussion that maps and vectors are > > functions not just because it's neat or possible, with the > > implementation one of many possibilities, but because they are > > associative, and associative collections are inherently functions of > > their keys/indices. > > > Lists/seqs are not associative, thus not functions. > > > Rich --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---