<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE>.hmmessage P {
        PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-FAMILY: Verdana; FONT-SIZE: 10pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.18854"></HEAD>
<BODY class=hmmessage bgColor=#ffffff>
<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: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=johnyseventy@hotmail.com href="mailto:johnyseventy@hotmail.com">johny
seventy</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=noelwelsh@gmail.com
href="mailto:noelwelsh@gmail.com">noelwelsh@gmail.com</A> </DIV>
<DIV style="FONT: 10pt arial"><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: 10pt arial"><B>Sent:</B> Tuesday, January 19, 2010 7:26
PM</DIV>
<DIV style="FONT: 10pt arial"><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/" target=_new>Sign-up
now - Free</A>
<P>
<HR>
<P></P>_________________________________________________<BR> For
list-related administrative tasks:<BR>
http://list.cs.brown.edu/mailman/listinfo/plt-scheme<BR>
<P>
<HR>
<P></P><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></BODY></HTML>