unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: srfi-72
Date: Wed, 11 Jul 2012 00:56:24 +0200	[thread overview]
Message-ID: <CAGua6m1a1AALteU-KPsE=R2L-ZPwNZUfAodt+CTb657kVwwBcQ@mail.gmail.com> (raw)

[-- 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 --]

                 reply	other threads:[~2012-07-10 22:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGua6m1a1AALteU-KPsE=R2L-ZPwNZUfAodt+CTb657kVwwBcQ@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).