<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">What is the "Module" language? Don't see it in any of the language selection menus.<br><br>Michael<br><br>--- On <b>Tue, 12/29/09, Robby Findler <i>&lt;robby@eecs.northwestern.edu&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Robby Findler &lt;robby@eecs.northwestern.edu&gt;<br>Subject: Re: [plt-scheme] Not so hygienic macros?<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: plt-scheme@list.cs.brown.edu<br>Date: Tuesday, December 29, 2009, 2:21 AM<br><br><div class="plainMail">On Mon, Dec 28, 2009 at 9:02 PM, michael rice &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt; wrote:<br>&gt; OK, here's some code (at bottom) to work with. Use of MATCH seems to cause a lot of<br>&gt; problems. Code is actually Scheme
 translation of some Logo code from an old TLC Logo<br>&gt; book (for the Mattel Aquarius no less) authored by John R. Allen.<br><br>I think you're running into what Matthew calls "hopeless top-level<br>problems". Eli can probably say more about what is going on with the<br>Swindle language that leads to these precise results.<br><br>In the meatime, I think that if you use the module language, I think<br>you'll find that the program behaves much more sanely. That is, get<br>rid of the eopl require, prefix the program with "#lang scheme", and<br>use the "Module" language to run the program in DrScheme. When I do<br>that, both versions of the program, the one you posted, and the one<br>below, behave identically on the example inputs you send, namely<br>producing #f for both of these calls:<br><br>&nbsp; (compare '(likes desi lucy) db)<br>&nbsp; (compare '(likes romeo juliet) db)<br><br>hth,<br>Robby<br><br>#lang scheme<br><br>(define match<br>&nbsp; (λ
 (pat1 pat2)<br>&nbsp; &nbsp; (if (null? pat1)<br>&nbsp; &nbsp; &nbsp; &nbsp; (null? pat2)<br>&nbsp; &nbsp; &nbsp; &nbsp; (if (null? pat2)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #f<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (if (match-first (car pat1) (car pat2))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (match (cdr pat1) (cdr pat2))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #f)))))<br><br>(define match-first<br>&nbsp; (λ (pat1 pat2)<br>&nbsp; &nbsp; (if (symbol? pat1)<br>&nbsp; &nbsp; &nbsp; &nbsp; (if (symbol? pat2)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (equal? pat1 pat2)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #f)<br>&nbsp; &nbsp; &nbsp; &nbsp; (cond ((symbol? pat2) #f)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ((match-first pat1 (car pat2)) (match (cdr pat1) (cdr pat2)))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (else #f)))))<br><br>(define compare<br>&nbsp; (λ (q
 db)<br>&nbsp; &nbsp; (cond ((null? db) #f)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (else (cond ((match q (car db)) #t)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (else (compare q (cdr db))))))))<br><br>(define db '((likes minnie mickey) (likes jack jill) (likes daisy donald)))<br></div></blockquote></td></tr></table><br>