[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Teachpack setup



Unfortunately, teachpacks only support procedure defintions, not
macros. So, the teachpack you are trying to build is impossible to
build. If you really need those macros defined in the teaching
language levels, you can, but you will have to write a tool. I can
help you with that, if you really do need macros. Let me know.

In the meantime, here is the teachpack that provides all of the
procedure defintions in the compat library plus your version of
`atom?'. (There are only macros in trace.ss). There is a little
trickyness because the compat library provides a different defintion
of atom which must be masked out.

(require-library "compats.ss")
(require-library "functios.ss")

(compound-unit/sig
  (import [plt : plt:userspace^])
  (link [function : mzlib:function^ ((require-library "functior.ss"))]
        [compat : mzlib:compat^ ((require-library "compatr.ss") function)]
        [atom : (atom?) ((unit/sig (atom?)
                           (import)
                           (define (atom? a)
                             (or (symbol? a)
                                 (number? a)
                                 (string? a)))))])
  (export
   (open (compat : (real-time
                    1+ 1- #%1+ #%1-
                    >=? <=? >? <? =?
                    flush-output-port
                    bound?
                    sort
                    gentemp                    
                    putprop getprop
                    new-cafe)))
   (open atom)))


Hope that helps,
Robby

emka@cso.com wrote:
> 
> I trying to build what would seem to be a relatively simple teachpack.  I'm
> struggling to put all of the pieces together from the examples distributed
> with DrScheme and the HelpDesk documentation.  I wondered if someone might
> help me get my first one set up?
> 
> What I would like to do is add the contents of the trace.ss and compat.ss
> libraries to the students standard environment.  In addition to this I
> would like to add the following definition:
> 
> (define (atom? a) (or (symbol? a) (number? a) (string? a)))
> 
> I was able to add only definition of atom? using the following simple
> teachpack:
> 
> (unit/sig (atom?)
>   (import plt:userspace^)
>   (define (atom? a) (or (symbol? a)
>                         (number? a)
>                         (string? a))))
> 
> I assume that to pull in and export both the trace and compat libraries I
> need to use  a compound signed unit but I'm not sure how to set it up.  I'd
> appreciate it if someone could give me a hand.
> 
> Thanks,
> 
> Eric