<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Thanks very much. This has put me in the right direction!<br><br><hr id="stopSpelling">From: jos.koot@telefonica.net<br>To: johnyseventy@hotmail.com; noelwelsh@gmail.com<br>CC: plt-scheme@list.cs.brown.edu<br>Subject: Re: [plt-scheme] Very basic macro question<br>Date: Tue, 19 Jan 2010 19:42:27 +0100<br><br>
<style>
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Verdana;font-size:10pt;}
</style>
<div><font face="Courier New">You probably want match. Alernatively you can use
syntax-case in a procedure for example:</font></div>
<div><font face="Courier New"></font> </div>
<div><font face="Courier New">#lang scheme<br>(define (trafo
x)<br> (syntax->datum<br> (syntax-case x ()<br> (id
(identifier? #'id) #'(identifier id))<br> ((a ...) #'(list a
...))<br> (else #'else))))</font></div>
<div> </div>
<div><font face="Courier New">(trafo 'a) ; --> (identifier a)<br>(trafo '(a b
c)) ; (list a b c)<br>(trafo "string") ; --> string</font></div>
<div><font face="Courier New"></font> </div>
<div><font face="Courier New">Jos</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-left: 5px; padding-right: 0px; margin-left: 5px; margin-right: 0px;">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><b>From:</b>
<a title="johnyseventy@hotmail.com" href="mailto:johnyseventy@hotmail.com">johny
seventy</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><b>To:</b> <a title="noelwelsh@gmail.com" href="mailto:noelwelsh@gmail.com">noelwelsh@gmail.com</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><b>Cc:</b> <a title="plt-scheme@list.cs.brown.edu" href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a>
</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><b>Sent:</b> Tuesday, January 19, 2010 7:26
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><b>Subject:</b> RE: [plt-scheme] Very basic
macro question</div>
<div><br></div>> Date: Sun, 17 Jan 2010 18:42:32 +0000<br>> Subject: Re:
[plt-scheme] Very basic macro question<br>> From: <a href="mailto:noelwelsh@gmail.com">noelwelsh@gmail.com</a><br>> To: <a href="mailto:johnyseventy@hotmail.com">johnyseventy@hotmail.com</a><br>>
CC: <a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a><br>>
<br>> On Sun, Jan 17, 2010 at 2:22 PM, johny seventy <<a href="mailto:johnyseventy@hotmail.com">johnyseventy@hotmail.com</a>>
wrote:<br>> > I understand why example<br>> > four works but is
there anyway I can do this without eval?<br>> <br>> A transformer
binding and syntax-local-value.<br>> <br>> It doesn't make sense to
parameterise a macro by a run-time value --<br>> macros are expanded before
run-time so they cannot depend on run-time<br>> values.<br>> <br>>
N.<br><br>Thanks for the responses. I just want to clarify one more
thing.<br><br>I have an sexpr which is created dynamically at runtime and I
want to transform this sexpr. It seemed really easy to do the transformation
using a syntax-rules macro. So the problem is I have missed the boat at this
stage as macro expansion has already taken place. The only way I can see how
to invoke the macro at this stage is by using eval. I am not sure what you
mean by a transformer binding and syntax-local-value. Is there a simple
example of this in action I could take a look at?<br><br>Thanks for your
patience. <br><br><br><br><br><br>
<hr>
Not got a Hotmail account? <a href="http://clk.atdmt.com/UKM/go/197222280/direct/01/">Sign-up
now - Free</a>
<BR><hr>
<BR>_________________________________________________<br> For
list-related administrative tasks:<br>
http://list.cs.brown.edu/mailman/listinfo/plt-scheme<br>
<BR><hr>
<BR><br>Se certificó que el correo entrante no contiene
virus.<br>Comprobada por AVG - www.avg.es <br>Versión: 9.0.730 / Base de datos
de virus: 270.14.150/2632 - Fecha de la versión: 01/19/10
08:34:00<br></blockquote>                                            <br /><hr />Not got a Hotmail account? <a href='http://clk.atdmt.com/UKM/go/197222280/direct/01/' target='_new'>Sign-up now - Free</a></body>
</html>