From: Mark H Weaver <mhw@netris.org>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: syntax-source
Date: Sat, 16 Apr 2011 22:21:54 -0400 [thread overview]
Message-ID: <87r5914ny5.fsf@netris.org> (raw)
In-Reply-To: <BANLkTikcmFJLdXW_oCVHreMi-OM_8bMtcQ@mail.gmail.com> (Stefan Israelsson Tampe's message of "Sat, 16 Apr 2011 22:12:50 +0200")
Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
> 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.
Source properties are associated with source forms using an eq? hash
table, and thus work only for parenthesized expressions, not for atoms.
See section 6.52.2 of the manual for more on this.
Best,
Mark
prev parent reply other threads:[~2011-04-17 2:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-16 20:12 syntax-source Stefan Israelsson Tampe
2011-04-17 2:21 ` Mark H Weaver [this message]
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=87r5914ny5.fsf@netris.org \
--to=mhw@netris.org \
--cc=guile-devel@gnu.org \
--cc=stefan.itampe@gmail.com \
/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).