scsh-users
[Top] [All Lists]

weirdness with when macro

To: scsh-news@zurich.ai.mit.edu
Subject: weirdness with when macro
From: briand@zipcon.net
Date: 10 Feb 2002 11:13:40 -0800
Organization: www.zipcon.net
Check out the following code :

Here's my definition of the when macro :

(define-syntax when
  (syntax-rules ()
    ((when test body ...)
     (if test 
         (begin body ...)))))

here's a snippet of code that isn't working :

           (write match)(newline)
           (when #f
             (display "when\n")
             (write match)(newline)
             (write (convert-poly line))
             (newline))

here's the extremely surprising output :

Error: exception
       (vector-ref '#() 0)
#f
when
#f

I don't know where to even start on this one.  I'm "loading" the macro
file from within the script, could that be a problem ?

Could there be some sort of conflict in the syntax name ?

Using the when macro from the command line works just fine, so I am
relatively sure that the macro is defined properly.

In the meantime I'm using (if ... (begin ...)) which works just fine.

ANY ideas ?


Brian

-- 

   "There is no right place for the dead to live."

    -- Kai, last of the Brunnen-G


<Prev in Thread] Current Thread [Next in Thread>