Or use vec to turn a sequence into a vector. As a general comment, using a dynamically typed language should not be seen as an opportunity not to think about types. You should still design your functions, think about the types they should receive, etc. Not having the compiler to check it for you actually places more burden on yourself and your self-discipline. You're basically taking responsibility for type checking in your head, in exchange for less (keyboard) typing and more flexibility.
Generally speaking, people complaining about conj makes me wonder if they see the above tradeoff in the same light as I do. On 8 February 2014 10:44, mynomoto <mynom...@gmail.com> wrote: > Maybe you could use mapv and filterv? This way you will always get a > vector and conj apends in the end. > > > On Friday, February 7, 2014 10:20:09 PM UTC-2, t x wrote: >> >> Consider the following: >> >> (cons 1 '(2 3 4)) ==> (1 2 3 4) >> (cons 1 [2 3 4]) ==> (1 2 3 4) >> >> (conj '(a b c) 1) ==> (1 a b c) >> (conj '[a b c] 1) ==> [a b c 1] >> >> >> ================================ >> >> Now, I would like something that _always_ >> * appends to the end >> >> cons is almost what I want, except it always appends to front. >> >> conj is not what I want -- in fact, I'm afraid of conj. Often times, >> I'll run map/filter on something, and suddenly, instead of a vector, I >> now have a list -- and conj changes the order of the item added. >> >> Thus, my question: is there a builtin to _unconditinoally_ append to >> the end of a list/sequence/vector? >> >> Thanks! >> > -- > 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 > Note that posts from new members are moderated - please be patient with > your first post. > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.