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