Hi people!

I have some experience with plain-vanilla Lisp (not Common Lisp or
Scheme); I have some questions about minor (or not) design decisions
in Clojure:

1) Why the fn special form receives an array as list of parameters?
That is, why Clojure is using:

(fn [x y]....

instead of

(fn (x y) ...

or both

Any rationale behing this decision?

2) I read in core.clj definitions like:

(def
 #^{:arglists '([x])
    :doc "Return true if x is a String"}
 string? (fn string? [x] (instance? String x)))

Why not:

(def
 #^{:arglists '([x])
    :doc "Return true if x is a String"}
 string? (fn [x] (instance? String x)))

that is, fn WITHOUT the name of the defined function. The name after
fn could be used in a recursive call, but, is it needed in this
context? for debugging purpose?

3) Why the redefs like:

;during bootstrap we don't have destructuring let, loop or fn, will
redefine later
(def
 #^{:macro true}
  let (fn* let [& decl] (cons 'let* decl)))

(def
 #^{:macro true}
 loop (fn* loop [& decl] (cons 'loop* decl)))

(def
 #^{:macro true}
 fn (fn* fn [& decl] (cons 'fn* decl)))

from loop* to loop, let* to let, fn* to fn... Are all *-ended names
special forms?

4) why not a def for macros? In the above fragment, I read that "fn is
a macro" is specified in a metadata tag. Why this decision? I'm
playing with an interpreter written in C# (not a compiler) and the
only metadata I need to process, by now, is the meta tag...

TIA

Angel "Java" Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez



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