Scala is a OO language with FP support, clojure is a functional language 
with OO support, they are very different.
It's normal for someone with a OO background to think that every method 
receives a object of some kind and it's good to know it's type in advance, 
and if you want polymorphism you create a subclass or implement an interface 
but in clojure functions are polymorphic not classes.
Let's take the function first as an example, if you give a String to first 
you'll get the first char, if you give a vector or list you'll get the first 
element, if you give a java array you'll get the element at index 0.
In scala each collection class has a overriden first method so you can have 
a static and pre-defined return type, in clojure the first function is 
itself polymorphic so it doesn't make sense to say that the return type of 
first is Object because it depends on the parameter.
You can code clojure's first function in scala but the parameter and return 
type would be Object, and you would have to typecast it anyway. (Maybe with 
scala's extremely fancy type system you can create a generic first function 
a la clojure but the type signature would make my eyes hurt :)
With doc, source (the functions) and the repl, a static typing system 
would'n be that useful

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