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: syntax-source
Date: Sat, 16 Apr 2011 22:12:50 +0200	[thread overview]
Message-ID: <BANLkTikcmFJLdXW_oCVHreMi-OM_8bMtcQ@mail.gmail.com> (raw)

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

Hi,

I want to get source location of a macro form and played a little with
syntax-source.
This should then print out something.

(define-syntax <+>
  (lambda (x)
    (syntax-case x ()
      ((o a b)
       (pk (syntax-source x))
       #'(+ a b)))))

(<+> 1 2)


In trying to use the location of x resulted in the  toplevel form location
and not the <+> form in a more complex example.
and using  #'o or #'a or #'b in stead of x on syntax-source form will lead
to pk prints out #f.

So the question is if it is possible to get a more exact location
information of the (<+> 1 2)
and in that case how?

Anyway a brief discussion how source and meta information is transported in
the guile macro framework would be
interesting.

Regards
Stefan

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

             reply	other threads:[~2011-04-16 20:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16 20:12 Stefan Israelsson Tampe [this message]
2011-04-17  2:21 ` syntax-source Mark H Weaver

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=BANLkTikcmFJLdXW_oCVHreMi-OM_8bMtcQ@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).