[plt-scheme] confusing certificate error

From: Dave Herman (dherman at ccs.neu.edu)
Date: Thu Apr 27 15:28:13 EDT 2006

Why does the following not work?

     (module init mzscheme
       (require (lib "class.ss"))
       (define-syntax (init-private stx)
         (syntax-case stx ()
           [(_ name value)
            (with-syntax ([(internal-name)
                           (generate-temporaries #'(internal-name))])
                  (init ((internal-name name) value))
                  (define name internal-name)))]))
       (provide (all-defined)))

When I use it from a client like:

     (module client mzscheme
       (require (lib "class.ss")
       (define cert-error%
         (class object%
           (init-private thing "value")
           (define/public (to-string)

I get the error: compile: reference is more certified than binding in: 
internal-name1. The offending line appears to be

     (define name internal-name)

When I eliminate that, it compiles.


Posted on the users mailing list.