libera/#sicl - IRC Chatlog
Search
14:57:47
beach
As I mentioned before, I defined a system COMMON-MACROS that define macros that expand to implementation-independent code (as much as possible).
14:57:53
beach
And today I defined a system COMMON-BOOT that creates a Clostrum environment in which those macros are defined as macros in the CL package. I also entered all the standard special operators in that environment.
14:57:58
beach
Using that environment, I can convert an expression [in this case (COND (3))] to an Iconoclast AST. The way that works is that the Iconoclast library creates a COND-AST using the s-expression-syntax to parse the expression.
14:57:59
beach
The converter recognizes that this AST represents a macro that is defined in the environment, so it converts the AST to a form which is then macro expanded into a LET form. The LET form is then parsed by the s-expression-syntax library and Iconoclast creates a LET-AST that represents something like (LET ((#:X 3)) (IF #:X #:X NIL)).
15:00:24
beach
At some point, I would like to do some macroexpansion directly from AST to AST, but I haven't managed to figure out how to do that in an acceptable way yet.
15:01:44
beach
It would not only save some parsing. It would also preserve source location information very precisely. Currently, for CSTs we rely on RECONSTRUCT (is that the name?).
15:08:29
beach
So the new thing here is that the s-expression-syntax library does all the syntax checking of special forms and standard macro forms.
15:11:17
beach
Then, of course, we should be able to use the same code that does this conversion in Second Climacs.