I guess I'm having trouble understanding what you're getting it, the way I'm interpreting it is that you want to have seqs represented differently from lists when outputted at the REPL. Also, I'm not sure if this is a point of confusion, but lazy sequences are different from sequence. Basically, lists and lazy sequences are two different implementations of an abstraction called a "sequence." This means that anywhere a sequence is asked for, either can be used, no questions asked. They're both sequences that have a certain set of behavior that they share, it's just how they go about that behavior that is different. When a list is printed out at the REPL, it -is- a sequence being printed out, there is literally no distinction between a list and the sequence view of that list, as evidenced by (let [a '(1 2 3)] (identical? a (seq a))) returning true. A vector meanwhile is - not- itself a sequence, it can only be viewed as one. That is the distinction between your examples.
On Jan 9, 8:47 pm, Greg Fodor <gfo...@gmail.com> wrote: > Right, what I was more pointing out is the fact that the printed > version of a sequence in the REPL is syntactically identical to that > of a list. Which, clearly for most intents and purposes is a great > representation in output for using the REPL while doing development. > However, for a newcomer particularly, I feel like it may be valuable > for a seq to annotate it's printed version with syntax that it is not > a literal list but is a sequence that, when expanded, results in the > set of values indicated by the list (or, the subset of values > indicated by the list of length *print-length*) > > Again, its a nitpick, but basically was a point of confusion for me > and I thought it might be a useful thing to realize since I'd guess > it's something that wears off in the first few days of using the > language. But, it might be a sticking point for some new users who are > learning the difference between lists (a la LISP) and lazy sequences a > la Clojure. > > On Jan 9, 8:41 pm, "Mark Engelberg" <mark.engelb...@gmail.com> wrote: > > > A sequence evaluates its elements on demand. The REPL needs to > > evaulate the elements in order to print them. You can control how > > many elements are printed by changing *print-length*. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---