<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Bleh, nevermind. It does work without the begin-for-syntax. I think
I need a syntax-local-transform, or whatever that function is that
executes stuff at phase+1.<br>
<br>
My original code was working because I had provided the syntax class
at phase 0 and 1, the non-working code only had the class at phase
1.<br>
<br>
On 02/27/2012 01:32 PM, Jon Rafkind wrote:
<blockquote cite="mid:4F4BE84F.3070405@cs.utah.edu" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Ok but it still doesn't work if I take out the (begin-for-syntax).<br>
<br>
(define-syntax-class x)<br>
<br>
Now its defined at phase 0. Anyway if I can get the syntax class I
can access its attributes (ryan said it was ok).<br>
<br>
On 02/27/2012 01:28 PM, Carl Eastlund wrote:
<blockquote
cite="mid:CAEOPtY0AL2xT84kVsZFjuoSpfBDVrQNPrE3Nt7Z2CnxCtLx8Rw@mail.gmail.com"
type="cite">You've bound x at phase 1, but you're looking up a
phase 0 binding here.<br>
<br>
Bug aside, I had no idea there was anything meaningful for
external users to do with the values underlying syntax classes.
What does the value let you do?<br>
<br clear="all">
Carl Eastlund<br>
<br>
<div class="gmail_quote">On Mon, Feb 27, 2012 at 3:21 PM, Jon
Rafkind <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:rafkind@cs.utah.edu">rafkind@cs.utah.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"> I thought
syntax-local-value would produce the syntax-class object
that a given identifier is bound to but it errors out with
'x is not defined as syntax'. Any ideas why? There is one
part of my original code base where this works and another
where it doesn't. I cannot seem to replicate the part that
works in a small test case.<br>
<br>
#lang racket<br>
<br>
(require (for-syntax syntax/parse))<br>
<br>
(begin-for-syntax<br>
(define-syntax-class x))<br>
<br>
(define-syntax (bar stx)<br>
(syntax-case stx ()<br>
[(_ name) (syntax-local-value #'name)]))<br>
<br>
(bar x)<br>
</blockquote>
</div>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">____________________
Racket Users list:
<a class="moz-txt-link-freetext" href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a>
</pre>
</blockquote>
<br>
</body>
</html>