[racket] Help understanding error: compile: access from an uncertified context to unexported variable from module

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Jun 17 08:34:26 EDT 2011

With this: 

#lang racket/load
(module macro racket
 (provide dlist)
 (define-syntax (dlist stx)
   #`(shared ([x (make-link x)])
       x))
 (define-struct link (l)))

(module use racket
 (require 'macro)
 (dlist 3))

It seems to work. 

On Jun 17, 2011, at 8:19 AM, Sam Tobin-Hochstadt wrote:

> On Fri, Jun 17, 2011 at 7:36 AM, Marijn <hkBst at gentoo.org> wrote:
>> 
>> My understanding so far is that `macro' expands to a use of the `link'
>> constructor which is somehow not allowed. All my attempts to duplicate
>> with simpler code failed to reproduce this error.
> 
> Here's a simpler version, with the same bug:
> 
> #lang racket/load
> (module macro racket
>  (provide dlist)
>  (define-syntax (dlist stx)
>    #`(shared ([x (link x)])
>        x))
>  (struct link (l)))
> 
> (module use racket
>  (require 'macro)
>  (dlist 3))
> 
> I think this is a bug in `shared' used in concert with `struct'.
> -- 
> sam th
> samth at ccs.neu.edu
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.