[racket-dev] Unable to expand cross-phase persistent module

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Tue Jul 29 19:26:21 EDT 2014

Here's a simpler version of this problem:

#lang racket
(parameterize ([current-namespace (make-base-namespace)])
  (expand (datum->syntax
           #f
           '(module m '#%kernel
              (#%declare #:cross-phase-persistent)))))

Sam

On Wed, Jul 16, 2014 at 12:59 PM, Sam Tobin-Hochstadt
<samth at cs.indiana.edu> wrote:
> Running `expand` on the module defined in `racket/tcp` errors.
>
> In transcript form:
>
> -> (define p (open-input-file
> "/home/samth/sw/plt/racket/collects/racket/tcp.rkt"))
> -> (define mod (read-syntax (object-name p) p))
> -> (parameterize ([current-namespace (make-base-namespace)])
>      (expand (namespace-syntax-introduce mod)))
> ; /home/samth/sw/plt/racket/collects/racket/tcp.rkt::2: module: cannot be
> ;   cross-phase persistent due to required modules
> ;   in: (#%module-begin (#%require (all-except (quote #%network) tcp-addresses)
> ;     (rename (quote #%network) c:tcp-addresses tcp-addresses)) (#%provide
> ;     tcp-connect tcp-connect/enable-break tcp-listen tcp-close
> ;     tcp-accept-ready? tcp-accept tcp-accept-evt tcp-accept...
> ; [,bt for context]
>
> I don't know why it would do this. The same thing happens with the
> minimal module that's declared cross-phase persistent.
>
> Sam

Posted on the dev mailing list.