[plt-scheme] Syntax in teachpack doesn't work.

From: Paulo J. Matos (pocm at soton.ac.uk)
Date: Thu Jun 19 09:42:25 EDT 2008

Hello, I am trying to create a simple syntax teachpack and I have:
(module iteration mzscheme

  ;; Simplified do
  (define-syntax for
    (syntax-rules ()
      ((for (var init cond step)
            command ...)
       (let loop ((var init))
         (if (not cond)
             (void)
             (begin
               command
               ...
               (loop step)))))))

  ;; Simplified^2 do
  (define-syntax repeat
    (syntax-rules ()
      ((repeat num command ...)
       (for (x 0 (< x num) (+ x 1))
            command ...))))

  (provide
   (all-defined)))

Then I do add the teachpack and load it but when I try to use repeat:
repeat: name is not defined, not a parameter, and not a primitive name

I am surely missing something but don't know what (this is still version 372).

Cheers,
-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK


Posted on the users mailing list.