[plt-scheme] Macro is misbehaving...

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Mon Jun 12 10:57:39 EDT 2006

Hi all,

I'm having a macro that's giving me the creeps. I've oversimplified
it, but the error is still there so don't worry if it really doesn't
make sense, what matters is why this is happening:
foo.scm
(module foo mzscheme

  (require (prefix slide: (lib "slide.ss" "slideshow"))
           (lib "class.ss"))

  (define obj%
    (class object%
      (define/public (get-pict s)
        (slide:inset 10 10))
      (super-new)))
  (define obj (make-object obj%))

  (define-syntax slide/foo
    (syntax-rules ()
      ((_ obj s ...)
       (slide:slide
        (if (symbol? s)
            s
            (send* obj s))
        ...))))

  (provide slide/foo)
  )

bar.scm
(module bar (lib "slideshow.ss" "slideshow")

  (require "foo.scm")

  (slide/foo
   (t "Hello")
   'next
   (t "Bye"))
)

I get:
expand: unbound variable in module in: next

wierder is that if I change send* to send I get:
send: method name is not an identifier in: (quote next)

Problem is, I need to send an the argument of slide/foo to an object
unless this argument is 'next, 'alt, generally speaking: a symbol. I'm
not being able to do this. Any ideas?

Cheers,
-- 
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group


Posted on the users mailing list.