
Port of PG's "On Lisp" to Clojure - ecounysis
http://thinkrelevance.com/blog/2008/12/12/on-lisp-clojure.html
======
ecounysis
Michael Fogus has also done some work porting On Lisp to Clojure. Chapters 2-5
are here: <http://blog.fogus.me/tag/onlisp/>

Halloway picked up where Fogus left off.

~~~
sandGorgon
Is the github repo (<https://github.com/stuarthalloway/onlisp-clojure>) not
being used by both of them ?

It's a wee bit scattered all over the place.

------
thurn
I would absolutely _love_ a more advanced Clojure book in the same vein as "On
Lisp", especially if Stuart Halloway is in any way involved. Most of the
content can probably be pretty similar modulo differences in the macro systems
and such (probably have to axe the reader macros chapter...)

------
w01fe
Note that this is from 2008, so some of the code samples are out-of-date
(e.g., case is now part of clojure.core).

------
andrewcooke
chapter 9 is particularly useful. clojure doesn't have hygienic macros, but it
does have namespaces, so it is not as likely as common lisp to silently
introduce naming problems. that's explained quite well there (better than i
have found anywhere else).

~~~
ToastOpt
Pardon, I don't know Clojure inside and out: are namespace significantly
better than packages for the purpose of macro hygiene?

~~~
chousuke
namespaces in combination with how syntax-quote (`) autoqualifies symbols and
let disallowing qualified identifiers makes it noticeably more difficult to
introduce a name clash.

for example the following macro results in an error when you try to run the
expanded code: (defmacro ex [x] `(let [y 1] (~x y)))

because it expands to (let [namespace/y 1] ...) which is disallowed. When you
need to, there is a way to force an unqualified symbol by explicitly quoting
and unquoting a symbol, and ` provides autogensyms, so it is very convenient
to use.

Namespace-qualifying also means that post-expansion changes to your local
namespace won't change the meaning of symbols that referred to things in an
external namespace when the macro was expanded.

------
mindblink
That's great! Thanks, Stuart, for doing this. When I was read PG's "On Lisp",
I kept wishing the examples were in Clojure.

