On Mon, Nov 22, 2010 at 8:00 AM, Ralph <grkunt...@gmail.com> wrote:

> At first this surprised me, since Clojure is dynamically typed, while
> F# is statically typed. After some thought, however, it occurred to me
> that Clojure can generate code very similar to statically typed
> languages using type hints. Of course, as soon as you add type hints,
> the code is no longer dynamically typed, but rather statically type.
> You lose the ability to do duck-typing on the arguments to a function.
>

Type hints do not enforce anything. You can pass arguments of the wrong type
to a type hinted function.

(defn foo [^String x] x)
(foo {}) ; works fine


> For those cases where performance is more important than flexibility,
> Clojure offers an advantage over "traditional" dynamic languages
> (Ruby, Python, etc.) in that the programmer can choose.
>

Type hints are only about performance not about losing flexibility.

The performance guarantees of Clojure (and that story just keeps getting
better and better) combined with it's dynamism are it's biggest draw for
many people.

David

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