I'm just referring to a language design tradeoff, specifically clojure picks ad-hoc polymorphism over making it easy to reason about types. Subtyping, polymorphism, and the ability to do efficient type inference (auto and human) are a real debate outside of clojure.
People wanting more specific functions are looking for it to be easier to know the type of something. Clojure and other dynamic languages tend to convert stuff for you all the time implicitly, which you get used to eventually, but the OP was talking about using this for education, and I think no one wants to learn about computational complexity before they can add something to the right side of a list. On Tue, Jul 17, 2018 at 1:07 PM Alex Miller <a...@puredanger.com> wrote: > > On Tuesday, July 17, 2018 at 11:06:51 AM UTC-5, Gary Trakhman wrote: >> >> It's pretty hard in clojure to keep track of a data structure and ensure >> some function introduced later in the middle of a data path doesn't seq it >> along the way. >> > > I'll again refer to the faq for when stuff like this comes up: > https://clojure.org/guides/faq#seqs_vs_colls > > There is definitely some learning involved in this but in general I feel > like it's not "pretty hard". The majority of the time you can even blur > over the coll/seq distinction entirely and just focusing on writing your > code to apply operations to sequential data. > > >> You get some discipline around this, but it adds to the learning curve. >> >> I wouldn't say polymorphism is better or easier than being stricter with >> types in a core library, especially when it comes to modifications, but >> it's super useful on reads (iterators, seqs, slurp). I will say that this >> is like a 2008-era debate whose ship has sailed in clojure. >> > > Not sure what you mean. Generally you shouldn't be using iterators at all > unless you're dealing with Java interop and slurp is something that returns > a string. This does not relate to any debate I'm aware of. > > -- > 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/d/optout. > -- 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/d/optout.