[plt-scheme] Problem with define-syntax

From: Chongkai Zhu (u0476504 at utah.edu)
Date: Thu Jan 19 00:30:27 EST 2006

======= At 2006-01-18, 19:57:10 Andre Mayers wrote: =======

>Good day
>
>I miss something which is surely basic. 
>How can I define a macro that will match a list ? 
>Why the following is not working ? 
>
>(define-syntax testListe
>  (syntax-rules ()
>    [(_ (1 3)) #t]
>    [(_ xxx) #f])) 
>
>
>(define x '(1 3))
>(testListe  x) 
>
>Thank you
>
>Andre Mayers, Ph.D., professeur  |  tel: 819-821-8000x2041
>Departement d'informatique       |  fax: 819-821-8200
>Universite de Sherbrooke         |  andre.mayers at usherbrooke.ca
>Sherbrooke (Quebec)              |  http://www.dmi.usherb.ca/~amayers
>Canada J1K 2R1
>

You are trying to match (quote (1 3)) with (1 3).

> (testListe (1 3))
#t

-
Chongkai



Posted on the users mailing list.