Javier Neira

Greenhorn
+ Follow
since Feb 16, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Javier Neira

there is various tutorials in google but i think thhis question would be in groovy forum, cause grails use groovy.
14 years ago

Ulf Dittmer wrote:What I don't get about Clojure is why it's not using either Lisp or Scheme syntax, but something else - "defn", square brackets for parameters, etc.



well Clojure was done like a new Lisp, without compatibiliies with previous dialects. it has direct syntax to create data structures like python or javascript ([1 2 3] for vectors, {:a 1 :b 2} for maps and #{:a :b :c} for sets and (1 2 3) for lists of course) and i think is a good improvement over Common Lisp or Scheme. F. e. params of a function is a vector.
14 years ago
Well Lisps usually are dinamyc typed and like ruby, groovy and so on is slower than static typed langs like java.
On the other hand data is immutables and it "create" new data in memory in each function call.
But for example Clojure use persistent data structure to optimize data geneation and you can attach metadata with type hints for optimize the code
But remember: "Premature optimization is the root of all evil"
Lisp is one of the references of all new languages from python to ruby, scala and of course clojure (which is a dialect of lisp like arc or scheme) and can be used in
any type of apps, including enterprise although it shines in ai apps (for example this)
14 years ago

John Todd wrote:Hey,
Since Clojure is a LISP dialect, does this mean that Clojure doesn't support OOP?
Thanks.



well already there was OOP support in at last Common Lisp:
Clojure interops directly with java and you can code clojure on top of its objects and create new classes and instances.
But i think that would go against the principles of language.
Therefore Clojure have runtime dispatch based on type (like OOP) AND value or metadata with multimethods

An example taken from that link:



And recently have implemented new forms of abstraction taking the good part of the OOP: protocols and datatypes
OOP have good and bad things and Clojure only picks the good ones ;-)
14 years ago
Mmm maybe too similar to what will be Java 7? groovy already seems to me too similar to java
14 years ago