[plt-scheme] confusing certificate error

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Apr 27 16:31:11 EDT 2006

Fixed in the SVN repository.

The problem was that `init' acts like a definition binding, but it
wasn't transparent to certificates in the same way as `define'. The
solution was to change the `init' form so that it adds 'certify-mode
properties as needed.

Matthew

At Thu, 27 Apr 2006 15:28:13 -0400, Dave Herman wrote:
> 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))])
>               #'(begin
>                   (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")
>                 "init.ss")
>        (define cert-error%
>          (class object%
>            (init-private thing "value")
>            (define/public (to-string)
>              thing)
>            (super-new))))
> 
> 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.
> 
> Thanks,
> Dave
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.