On Mon, Nov 9, 2009 at 8:31 PM, Mark Engelberg <mark.engelb...@gmail.com> wrote: > I imagine the rationale is efficiency. Every core function could > conceivably do a number of runtime checks to make sure that each input > is the right kind of type, and then Clojure might feel more sluggish. > So instead, the core functions just worry about what to do for the > appropriate inputs. If you pass a bogus input, the consequence > depends entirely on how that particular function was coded. It might > return a spurious result, or it might error. There are numerous > examples of this in the Clojure API.
I understand this, but it creates another kind of problem: When programmers make mistakes (and I, being not a perfect human being, make lots of mistakes) the system behaves inconsistently in a place where one would expect consistency (type checking): sometimes it blows in your face (like even?), sometimes it does that silently (like contains?). >From a software engineering perspective is seems a bit dangerous. Unless of course, programmers are perfect and never make mistakes, for those kind, this discussion might seem ridiculous. I, for one, prefer the blow in your face (ie, like even?) design approach than the silent one. But above all, consistency would be nice to have. But I understand the rationale for efficiency. Tough I question if there is really a rationale of efficiency or this issue was really never really thought about (considering that Clojure is such a fast moving target, that would be normal). Peace, Tiago --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---