Hi, Am 05.01.2009 um 10:30 schrieb Shmurk:
I have one questions about the "programming style" used in the Clojure standard library. For example, in the file core.clj, I see: (. *out* (flush))
This is the oldest form.
Why is it written like this? Could we write it like this instead: (. *out* flush)
Yes. It could be as well written like this.
or the more concise: (.flush *out*)
This is the newest form complementing the Classname. form for (new Classname). While these new forms are available, what would be the use of rewritten everything? The last form is translated to the second anyway. 1:1 user=> (macroexpand-1 '(.foo bar)) (. bar foo)
Is it more efficient internally?
Since this is basically all the same, I wouldn't expect it to have some effect on efficiency. Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature