I used to write _ in the expression as a shorthand to the head of the pattern as follows:<br><br><div style="margin-left: 40px; font-family: courier new,monospace;">Welcome to DrScheme, version 371 [3m].<br>Language: Pretty Big (includes MrEd and Advanced Student).<br>
> (define-syntax (and2 stx)<br> (syntax-case stx () <br> ((_ a b c d ...)<br> #'(_ a (_ b c d ...))) ;;; works <br> ((_ a b)<br> #'(if a b #f))))<br>> (and2 #t #t #t)<br>#t<br>> (and2 #t #t #t #f)<br>
#f<br></div><br>In v4 - the above causes the error of "<span style="font-family: courier new,monospace;">_: wildcard not allowed as an expression in (_ #t (_ #t #f))</span>". I noticed this error using emacs & v4 on Linux. <br>
<br>I tried to replicate it using DrScheme (on Windows) and found that with the Module language it will cause the same error, but if using legacy language of Pretty Big, it appears to be behave the same as in 37x. <br><br>
<br><div style="margin-left: 40px; font-family: courier new,monospace;">Welcome to DrScheme, version 4.0 [3m].<br>Language: Module; memory limit: 128 megabytes.<br>> (and2 #t #t #f) ;; throw error <br>. _: wildcard not allowed as an expression in: (_ #t (_ #t #f))<br>
</div><br><div style="margin-left: 40px; font-family: courier new,monospace;">Welcome to DrScheme, version 4.0 [3m].<br>Language: Pretty Big (includes MrEd and Advanced Student); memory limit: 128 megabytes.<br>> (and #t #t #f) ;; works<br>
#f<br></div><br><br><br><div class="gmail_quote">On Mon, Jun 23, 2008 at 5:44 PM, Jos Koot <<a href="mailto:jos.koot@telefonica.net" target="_blank">jos.koot@telefonica.net</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Courier New" size="2">May be you missed the fact that _ has
become a wild-card.</font></div>
<div><font face="Courier New" size="2">Jos</font></div><div><div></div><div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; 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;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; 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;">
<b>From:</b>
<a title="jos.koot@telefonica.net" href="mailto:jos.koot@telefonica.net" target="_blank">Jos
Koot</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;"><b>To:</b> <a title="yinso.chen@gmail.com" href="mailto:yinso.chen@gmail.com" target="_blank">YC</a> ; <a title="plt-scheme@list.cs.brown.edu" href="mailto:plt-scheme@list.cs.brown.edu" target="_blank">pltscheme</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;"><b>Sent:</b> Tuesday, June 24, 2008 2:39
AM</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;"><b>Subject:</b> Re: [plt-scheme] (v4) wildcard
not allowed in expression</div>
<div><br></div>
<div><font face="Courier New" size="2">It works for me though:</font></div>
<div><font face="Courier New" size="2"></font> </div>
<div><font face="Courier New" size="2">#lang scheme</font></div>
<div> </div>
<div><font face="Courier New" size="2">(define-syntax x<br> (syntax-rules
()<br> ((_ 1 _) 'one)<br> ((_ _ 2) 'two)))</font></div>
<div> </div>
<div><font face="Courier New" size="2">(x 1 monkey) ; one<br>(x monkey 2) ;
two</font></div>
<div><font face="Courier New" size="2"></font> </div>
<div><font face="Courier New" size="2">Welcome to DrScheme, version
4.0.0.1-svn16jun2008 [3m].<br>Language: Module.</font></div>
<div><font face="Courier New" size="2"></font> </div>
<div><font face="Courier New" size="2">Jos</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; 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;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; 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;">
<b>From:</b>
<a title="yinso.chen@gmail.com" href="mailto:yinso.chen@gmail.com" target="_blank">YC</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;"><b>To:</b> <a title="plt-scheme@list.cs.brown.edu" href="mailto:plt-scheme@list.cs.brown.edu" target="_blank">pltscheme</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;"><b>Sent:</b> Tuesday, June 24, 2008 12:32
AM</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;"><b>Subject:</b> [plt-scheme] (v4) wildcard not
allowed in expression</div>
<div><br></div>Hi - <br><br>It seems that in v4 `_` can no longer exist in
the expression position for syntax-case, is there a reason for the change?
<br><br>Thanks,<br>yc<br><br>
<p>
</p><hr>
<p></p>_________________________________________________<br> For
list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br></blockquote>
<p>
</p><hr>
<p></p>_________________________________________________<br> For
list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br></blockquote></div></div></div>
</blockquote></div><br>