[plt-scheme] Problem with define-syntax on 200

From: Blake McBride (blake at integra-online.com)
Date: Tue Jul 30 22:56:28 EDT 2002

Greetings,

I took a define-syntax definition for 'do' from "The Scheme
Programming Language" by Dybvig and tried it under DrScheme
version 200.  The definition and error is as follows:

(define-syntax debug-do
   (lambda (x)
     (syntax-case x ()
       ((_ (binding ...) (test res ...) exp ...)
        (with-syntax ((((var val update) ...)
                       (map (lambda (b)
                              (syntax-case b ()
                                ((var val)
                                 (syntax (var val var)))
                                ((var val update)
                                 (syntax (var val update)))))
                            (syntax (binding ...)))))
          (syntax (let doloop ((var val) ...)
                    (if test
                        (begin (if #f #f) res ...)
                        (begin exp ... (doloop update ...))))))))))

(define try
   (lambda (m)
     (debug-do ((i 0 (+ i 1)))
       ((> i m) 88)
       (display i)
       (newline))))


'try' works fine with the real 'do' but gives the following error with 
'debug-do'
at definition time:

map: expects type <list> as 2nd argument, given: 
#<syntax:C:\Scheme-debugger\debugger.scm:266:28>; other arguments were: 
#<procedure:...ger\debugger.scm:260:28>

(debugger.scm is a debugger I'm working on - It actually works!)

I need this code to work for real.  It's not just an exercise for me.
Your help is appreciated.

--blake

-------
Download source code to my Dynace Object Oriented
Extension to C  from  http://algorithms.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20020730/0f06b0c2/attachment.html>

Posted on the users mailing list.