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

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Sat Jun 21 01:42:13 EDT 2008

I tried to use that teachpack and ran into similar problems as Paulo.

The issue is not in the definition of the module, which as Robby  
points out is correct, but seems to appear when one modifies the  
definition of the teachpack, and accidentally saves the modified  
module using the advanced student (custom) language, rather than the  
module language.

Just make sure you're in the good language when editing/saving the  
teachpack, and it should work nicely.

Hope this helps,

-- Éric


On Jun 21, 2008, at 07:05 , Robby Findler wrote:

> I was able to use that teachpack successfully under v372 (and in the
> soon-to-be-released version). This is what I see, for example:
>
> Welcome to DrScheme, version 372 [3m].
> Language: Advanced Student custom; memory limit: 128 megabytes.
> Teachpack: iteration.ss.
>> repeat
> repeat: bad syntax
>> (repeat 2 (printf "hi\n"))
> hi
> hi
>>
>
> On Thu, Jun 19, 2008 at 8:42 AM, Paulo J. Matos <pocm at soton.ac.uk>  
> wrote:
>> 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
>> _________________________________________________
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.