Re:One Major Difference Between Clojure and Common Lisp
by PuercoPop on Saturday September 12, 2015 @12:30AM
(#10207219)
His build implementation uses tail recursion which is not preferred in CL. One can build in a similar way that as shown at the end.
A much bigger difference imho between Clojure and Common Lisp is that the former is built on abstractions, conj, while the latter is built on concrete cons cells. There are more other significant differences but I don't want to flame/argue.
[ Parent
| on HN ]
Re:One Major Difference Between Clojure and Common Lisp
by EdwardDiego on Saturday September 12, 2015 @02:06AM
(#10207430)
Is it even recursing in the tail position though? Reading the code it looks to me like the recursion result is used as an argument to a subsequent function call (append).
Re:One Major Difference Between Clojure and Common Lisp
by rachbowyer on Saturday September 12, 2015 @06:36AM
(#10207758)
Spot on! The code fails as the author has used nil? rather than empty? The recursive call is not from the tail position so tail call optimisation is not possible in any language.
Re:One Major Difference Between Clojure and Common Lisp
by PuercoPop on Saturday September 12, 2015 @01:57PM
(#10208744)
> tail call optimisation is not possible in any language.
Afaik it is possible in racket. Read the note at the end here: http://matt.might.net/articles/lexers-in-racket/