Sure, you just need to require and provide b at your favorite phase level
in c. Replacing module c with the following makes the rest compile for me:


(module c racket/base
  ;; Require & provide everything except `some-fun` at phase 0
  (require (except-in (submod ".." b) some-fn))
  (provide (all-from-out (submod ".." b)))
  ;; Require & provide everything at phase 1
  (require (for-syntax (submod ".." b)))
  (provide (for-syntax (all-from-out (submod ".." b)))))

On Sun, Jun 28, 2015 at 3:01 AM, Alexis King <lexi.lam...@gmail.com> wrote:

> I ran across some behavior that I find a little bit surprising. Consider
> the following module:
>
>   #lang racket/base
>
>   ; the definition of some-fn
>   (module a racket/base
>     (provide some-fn)
>     (define (some-fn) (void)))
>
>   ; provides some-fn in multiple phase levels
>   (module b racket/base
>     (require (submod ".." a)
>              (for-syntax (submod ".." a)))
>     (provide some-fn
>              (for-syntax some-fn)))
>
>   ; excludes some-fn in phase 0... and phase 1?!
>   (module c racket/base
>     (require (except-in (submod ".." b) some-fn))
>     (provide (all-from-out (submod ".." b))))
>
>   (require 'c)
>   (begin-for-syntax
>     ; not defined!
>     some-fn)
>
> This demonstrates that except-in appears to remove identifiers from *all*
> phase levels, not just phase 0. Is there any way to restrict except-in to a
> particular phase level, or is there a different way to accomplish that sort
> of behavior?
>
> For context, I ran into this while seeing what it would be like to create
> an “r5rs+” lang that permits things like ‘syntax-case’, so I effectively
> want to provide all the bindings from ‘r5rs’, but I want to exclude the
> ‘#%top’, ‘#%datum’, and ‘#%app’ bindings that r5rs exports for phase 1,
> which restrict expressions in phase 1 to only use syntax-rules (I’d replace
> these with the normal bindings exported for phase 0).
>
> Alexis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to