[plt-scheme] define-unit meaning in combinator-example.ss?

From: Larry Evans (cppljevans at suddenlink.net)
Date: Tue Jun 24 16:06:01 EDT 2008

While trying to understand:

   (define-unit lambda-calc



I first searched the index:


for 'define-unit'.  Since it wasn't there, I thought maybe it was
defined in the current language.  Looking at the top of
*/combinator-example.ss, I saw:

   (require scheme/unit

So, I grep'ed the files scheme/unit and found:

find . -name \*.ss -exec grep -e 'define-unit' {} \; -ls
          (define-unit name imports exports elem ...))]))
16960391    4 -rw-r--r--   1 evansl   evansl       3302 Jun 13 20:50 

which, with more context, is:

(define-syntax (finish-a-unit stx)
   (syntax-case stx (import export)
     [(_ orig-stx name imports exports elem ...)
          (provide name)
          (define-unit name imports exports elem ...))]))

So, I looked in the index to find that define-syntax defined:


however, there it's defined as:

     (define-syntax id

       (syntax-id-rules (literal-id ...)

         [pattern template]


which doesn't seem to match the:

(define-syntax (finish-a-unit stx)

in ./unit/lang.ss since (finish-a-unit stx) does not match, AFAICT,
the id in '(define-syntax id'.

So, how can I figure out what the 'define-unit' in
combinator-example.ss means?

Any help is appreciated.


Posted on the users mailing list.