I'm the author of the Clojure->Scheme compiler. I'm looking into the possibility making the compiler not require the JVM for macro-expansion.
Clojure makes use of vectors and maps directly as syntax -- I was looking into using Gambit's bracket-keyword to produce literal vectors from the reader, but it seems the reader just attaches a symbol to the head of a list, as opposed to evaluating the forms.
I'd like the macro-expansion stage to have access to the actual maps, vectors etc. as some Clojure macros behave differently depending on whether the forms are lists or vectors.
Is it possible to hook into the reader this way? (Perhaps as a fallback I could just tree-walk the forms to replace instances of the vector-literal and hash-literal markers with actual vectors and maps before macro-expansion.)
Afficher les réponses par date
Not long after posting, I found a great example on the mailing list of extending the Gambit reader, which is exactly what I needed : http://permalink.gmane.org/gmane.lisp.scheme.gambit/487
By changing the handler for #[ from ##read-vector-or-list to my custom read-vector-literal form, I can construct exactly the forms I want!
Wrong link to the reference, my apologies : http://permalink.gmane.org/gmane.lisp.scheme.gambit/4874
On 2013-03-24, at 2:47 AM, Nathan Sorenson nathan.d.sorenson@gmail.com wrote:
Wrong link to the reference, my apologies : http://permalink.gmane.org/gmane.lisp.scheme.gambit/4874
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Hello Nathan. It is nice to see you are still working on the Clojure->Scheme compiler. I just learned you gave a talk about it at the ClosureWest conference. Are your slides available somewhere?
Marc
On 2013-03-24, at 9:06 AM, Marc Feeley feeley@iro.umontreal.ca wrote:
On 2013-03-24, at 2:47 AM, Nathan Sorenson nathan.d.sorenson@gmail.com wrote:
Wrong link to the reference, my apologies : http://permalink.gmane.org/gmane.lisp.scheme.gambit/4874
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Hello Nathan. It is nice to see you are still working on the Clojure->Scheme compiler. I just learned you gave a talk about it at the ClosureWest conference. Are your slides available somewhere?
Marc
For those interested, I've put the slides of Nathan Sorenson's presentation on the clojure-scheme compiler on the wiki. Here's a direct link to the .pdf file:
http://www.iro.umontreal.ca/~gambit/Sorenson-Clojure-to-Native-via-Scheme.pd...
It is a quite colourful presentation... I particularly like the Guy Steele slide!
Marc