On Fri, 2011-10-21 at 15:41 -0400, David Nolen wrote:
> Just because we have dynamic types does not give us the freedom to not
> consider them.

If all of these dynamics types and all of the tests "respected nil"
in its many meanings then 
  (when s ..., 
  (when (seq s)...,
  (when (empty? s)...,
would not be an issue. (when s...) would "just work".

> 
> 
> Clearly express a consideration about the types at play.

Clojure was supposed to transparently substitute things like sequences
and vectors everywhere that lisp used lists. That would be true if nil
was respected but is not true now and this complicates the code without
apparent benefit, in my opinion.

In lisp you can ask what the type is (e.g. by calling consp, vectorp,
etc) but these type-specific predicates are relatively rarely used.
In fact, when they are used then you are struggling with data-level
issue that could probably be abstracted away (e.g. a code smell).

Clojure is a great language but the nil handling is, in my opinion,
a design flaw. It forces the introduction of (empty?...) and an
awareness of the data types into view unnecessarily.

Tim Daly
Literate Software




-- 
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

Reply via email to