On Sun, Nov 30, 2008 at 1:33 PM, Chouser <[EMAIL PROTECTED]> wrote: > > On Sun, Nov 30, 2008 at 2:29 PM, Mark Volkmann > <[EMAIL PROTECTED]> wrote: >> >> Many of the provided functions take arguments named "coll" or "seq". >> Is the choice meant to indicate something significant about what can >> be passed? As far as I know, every collection can be treated as a >> sequence. Maybe the opposite isn't true. > > The name 'seq' should never be used, in my opinion, except when > referring to the clojure.core/seq function that returns a seq for a > collection. 'coll' is usually sufficiently accurate, in that > functions generally should take a collection and get a seq from it if > needed. This often happens transparently as many standard functions > take a collection and call seq on it internally (first, rest, last, > etc.) > > If you actually have a function that relies on being given a seq and > not a collection, I suppose 'coll' would be a misleading name. In > that case perhaps 's' or 'sequence' or something would do, but never > 'seq'. Although it doesn't directly generate an error to use the word > 'seq' as an arg or local, it shadows the builtin 'seq' function and is > likely to cause confusing errors if you ever try to call the standard > function.
There aren't as many cases of this as I had thought. Here are the cases I found. cons takes an argument named "seq". do-seq and for take an argument named "seq-exprs". into-array takes an argument named "aseq". long-array takes an argument whose name ends with "seq". select-keys takes an argument named "keyseq". Are you saying it would be more accurate to change "seq" to "coll" in each of these cases? -- R. Mark Volkmann Object Computing, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---