[plt-scheme] simply-scheme / teachpacks can't overwrites an existing namespace symbol?

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Sat Feb 19 06:19:46 EST 2005

Hi everyone,


I've been trying to write a nice teachpack for the book Simply Scheme:

    http://www.cs.berkeley.edu/~bh/simply-toc.html

Simply Scheme uses a set of primitives that are nice for beginner
programmers, including an abstraction that treats symbols, strings, and
numbers in a similar fashion.  I used to use a teachpack for v103 written
by Robert Findler, but that code is really stale now and doesn't work with
PLT Scheme v209:

    http://hkn.eecs.berkeley.edu/~dyoo/cs3/simply-teachpack.scm


With some work, I now have something that works as a module; I can import
the Simply Scheme definitions, and things just work beautifully:

###
> (require (lib "simply-scheme.ss" "simply-scheme"))
> (word 'comp 'uter)
computer
> (first '(this is a test))
this
> (first 12345)
1
> (first 'hello)
h
> (+ "3" "17")
20
###

And as soon as I figure out how PLaneT works, I'll be happy to submit the
code up there.  *grin*


But I'm running into difficulty because the current teachpack system
prevents me from introducing symbols that already exist in the user's
namespace.  In particular, the function 'verify-no-new-exports' in
teachpack.ss is causing me great grief.

(http://download.plt-scheme.org/scheme/plt/collects/drscheme/private/teachpack.ss)

This is a major problem for me, because many of the definitions in
simply-scheme.ss are meant to make make several mzscheme primitives (like
the last example with addition) a little nicer to work with.

How do I get around this?  I'd really like to update my page at:

    http://hkn.eecs.berkeley.edu/~dyoo/cs3/simply-teachpack/index.html

with something that works on modern PLT Scheme.


Thanks in advance!



Posted on the users mailing list.