Yup. Tried that too. It expands the code (which seems right at first), and before it can continue to reveal the wonders beneath it, it stops and replaces the expanded form with &#39;Error&#39;.<br><br>That&#39;s very nice indeed.
<br><br><div class="gmail_quote">On Jan 19, 2008 6:05 PM, Gregory Cooper &lt;<a href="mailto:greg@cs.brown.edu">greg@cs.brown.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Actually, though, since the error seems to arise during the expansion<br>of your macro, you&#39;d probably find that the Macro Stepper is more<br>appropriate than the Debug button. &nbsp;(The Debug button won&#39;t show you<br>
what happens until after macro expansion is finished.)<br><div><div></div><div class="Wj3C7c"><br>On Jan 19, 2008 12:43 PM, Ran Gutin &lt;<a href="mailto:manicmessiah@gmail.com">manicmessiah@gmail.com</a>&gt; wrote:<br>&gt; Wait. It seems that you&#39;re right.
<br>&gt; I&#39;m running version 371. So I&#39;ll update now.<br>&gt;<br>&gt; :) Thanks. I&#39;ll update you in how things go.<br>&gt;<br>&gt;<br>&gt;<br>&gt; On Jan 19, 2008 3:57 PM, Gregory Cooper &lt; <a href="mailto:greg@cs.brown.edu">
greg@cs.brown.edu</a>&gt; wrote:<br>&gt; &gt; What version of DrScheme are you running? &nbsp;There was a bug in the v371<br>&gt; &gt; debugger that would produce error messages like that, but it should<br>&gt; &gt; have been fixed in v372 (and in svn as of r7169 I think).
<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On Jan 19, 2008 10:28 AM, Ran Gutin &lt; <a href="mailto:manicmessiah@gmail.com">manicmessiah@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt; (define (doublequoted-symbol? sym)
<br>&gt; &gt; &gt; &nbsp; (and (pair? sym) (eqv? (car sym) &#39;quote)))<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; (define-syntax match<br>&gt; &gt; &gt; &nbsp; (syntax-rules ()<br>&gt; &gt; &gt; &nbsp; &nbsp; ((match vars [pfirst prest ...] body ...)
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;(cond<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; ((and (not (doublequoted-symbol? (quote pfirst)))<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(symbol? (quote pfirst)))<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; (let ((pfirst (car vars)))
<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (match (cdr vars) [prest ...] body ...)))<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;((eqv? pfirst (car vars))<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; (match (cdr vars) [prest ...] body ...))<br>&gt; &gt; &gt;
<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;(else #f)))<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp; &nbsp; ((match vars [] body ...) (begin body ...))))<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; (match &#39;(1 2 3) (one 2 three)<br>&gt; &gt; &gt; &nbsp; (display three))
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Sorry for not commenting on the code, but here&#39;s a basic idea of what it<br>&gt; &gt; &gt; SHOULD do:<br>&gt; &gt; &gt; (match &#39;(1 2 3) (1 2 3) (display 3)) should match perfectly and display
<br>&gt; 3 on<br>&gt; &gt; &gt; the terminal (it doesn&#39;t).<br>&gt; &gt; &gt; (match &#39;(1 2 3) (one two three) (display 3)) works perfectly, and prints<br>&gt; 3.<br>&gt; &gt; &gt; (match &#39;(1 2 3) (&#39;one &#39;two &#39;three) (display &#39;one)) - This should fail to
<br>&gt; &gt; &gt; match the pattern altogether, as symbols which are already quoted are<br>&gt; &gt; &gt; matched for equality, rather than used as identifiers as above. This<br>&gt; dies<br>&gt; &gt; &gt; miserably without returning #f.
<br>&gt; &gt; &gt; (match &#39;(1 2 3) (one 2 three) (display three)) - This should immediately<br>&gt; &gt; &gt; create an alias for the values 1 and 3 (&#39;one&#39; and &#39;three) and match the<br>&gt; &gt; &gt; second values for equality. Unfortunately, this is not the case.
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;(match &#39;(1 2 3) (one 2 three)<br>&gt; &gt; &gt; &nbsp; &nbsp;(display three))<br>&gt; &gt; &gt; ... gives the following error:<br>&gt; &gt; &gt; &quot;let: bad syntax (not an identifier) in: 2&quot;
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; It seems to be completely ignoring the conditional.<br>&gt; &gt; &gt; So I performed a test:<br>&gt; &gt; &gt; (and (not (doublequoted-symbol? (quote 2)))<br>&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(symbol? (quote 2)))
<br>&gt; &gt; &gt; ... actually returns FALSE. So then why is the conditional statement<br>&gt; &gt; &gt; branching off completely wrong?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; And then, here&#39;s the real kill. I can&#39;t debug the damn thing.
<br>&gt; &gt; &gt; &nbsp;Doing so sends an alert window flying in my face, and a larger one<br>&gt; behind<br>&gt; &gt; &gt; it.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &quot;rest: expected argument of type &lt;non-empty list&gt;; given ()
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10: can-step-out?<br>
&gt; &gt; &gt;<br>&gt; &gt; &gt; rest: expected argument of type &lt;non-empty list&gt;; given ()<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest
<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10: can-step-out?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; rest: expected argument of type &lt;non-empty list&gt;; given ()<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===
<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10: can-step-out?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; rest: expected argument of type &lt;non-empty list&gt;; given ()
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10: can-step-out?<br>
&gt; &gt; &gt;<br>&gt; &gt; &gt; rest: expected argument of type &lt;non-empty list&gt;; given ()<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest
<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10: can-step-out?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; rest: expected argument of type &lt;non-empty list&gt;; given ()<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===
<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10: can-step-out?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; rest: expected argument of type &lt;non-empty list&gt;; given ()
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp;=== context ===<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mzlib\list.ss:295:2: rest<br>&gt; &gt; &gt; C:\Program Files\PLT\collects\mztake\debug-tool.ss:804:10:<br>&gt; can-step-out?&quot;
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; ^ Can someone tell me what the hell is going on?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; _________________________________________________<br>&gt; &gt; &gt; &nbsp; For list-related administrative tasks:
<br>&gt; &gt; &gt; &nbsp; <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt;<br>&gt;
<br></div></div></blockquote></div><br>