unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* srfi-72
@ 2012-07-10 22:56 Stefan Israelsson Tampe
  0 siblings, 0 replies; only message in thread
From: Stefan Israelsson Tampe @ 2012-07-10 22:56 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]

Hi,

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?

/Stefan

[-- Attachment #2: Type: text/html, Size: 1970 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-10 22:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-10 22:56 srfi-72 Stefan Israelsson Tampe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).