[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Stefan Israelsson Tampe
Subject: srfi-72
Date: Wed, 11 Jul 2012 00:56:24 +0200


I have thought about what abstraction is needed to be supported by psyntax in order to implement srfi-72.

Consider macro expansion of code #'C, ideally we would like to write the expansion as E#'C with E an expansion operator. For two
expansion operators E,F we would expect to support this E(F(#'C)) = (E o F)#'C eg it's possible to compose expansion operators.
I also expect an identity expansion I as the expansion in the current module. Assume that #'C1 ... is embeded in lower level code. The feature we are searching for is the following lambda

  (/. E (E I code(#'C1 ...)))

Now E does not touch the lower level code part it is only a syntax expansion for the higher order syntax #'C, on the other hand I expands in the lower level.
and one would expect via with-syntax that expansion rules for the higher level is build up to Q1 ... so that we could compile to

 (/. E code(EQ1#'C1 ...))

and we could drop the lambda into the syntax _expression_ and be viewed as a anonymous macro. This will probably be a kind of lambda in reality
possible marked to make sure non macro lambdas get expanded. when the expander sees the lambda it will call the lambda with expansion parameters so that in the end it will work on a new syntax object eg. it will expand like  E#'D( (EQ1)C1 ...). To note is that if we used the old
semantic of #`, #, etc. we would end up with E#'D( Q1C1 ...) in stead which is not that nice.

what do we have
(/. E ....)  -  an in syntax embeded lambda
EQ1#'C1  ->   (f Q1#'C1 E) - f is a function that takes a syntax object and join another syntax operator
marking??                                                        - dunno
syntax objects with embedded lambdas go files  - dunno

So the question is could we cook something like this up with the current psyntax system?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]