This code is practically the simplest code walker possible
I was premature in saying this. That code is longer than it needs to be because it's doing some clever stuff, including trying to be fully portable.
If you look at pg.11 of the 2nd paper in the linked document: http://www.merl.com/reports/docs/TR93-17.pdf there is a simpler code walker that also performs macroexpand-all.
Vish
On Tue, May 18, 2010 at 12:29 AM, Vishvajit Singh vishvajitsingh@gmail.com wrote:
That is really interesting, but.. geez! It really drives home that Common Lisp has too many special forms. This code is practically the simplest code walker possible and it's still 300 lines.
I always wondered why, for example, both LET and LET* need to be special forms, or why both FLET and LABELS need to be. It seems like only one needs to be a special form, and the other could be implemented as a macro on top of the other. TAGBODY seems like it could be written as a macro if your implementation has tail-call optimization. (I'd be interested to see someone give that a try.)
One of the wonderful things in the original conception of Lisp is the small number of primitives: http://lib.store.yahoo.net/lib/paulgraham/jmc.lisp
Vish
On Fri, May 14, 2010 at 8:49 AM, Brian Connoy BConnoy@morrisonhershfield.com wrote:
Justin, you've probably dug this up already. Have a gander at: http://john.freml.in/macroexpand-dammit
BC
On Tue, May 11, 2010 at 12:24:54PM -0400 or thereabouts, Justin Giancola wrote:
While I don't have a presentation per se, I'd like to propose a discussion on macro hygiene and scoping inspired by ideas encountered in Doug's book. I'm going to try to get together a few examples during lunch at work.
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp