Just for fun, if you want to be a little bit naughty, you can define
a custom #%top transformer that will make unbound identifiers that
are fully qualified automatically resolve to their imported values.
Just do a little bit of processing on the unbound identifiers:
#lang racket
(require
Now cam someone show me how to get Racket-style requiring in Python :-)
> On Jun 29, 2016, at 9:35 AM, Jay McCarthy wrote:
>
> I think you want this:
>
> #lang racket/base
> (require (for-syntax racket/base
> syntax/parse
>
I think you want this:
#lang racket/base
(require (for-syntax racket/base
syntax/parse
racket/require-transform
racket/syntax))
(define-syntax ns-in
(make-require-transformer
(λ (stx)
(syntax-parse stx
[(_ mp:id)
> On Jun 29, 2016, at 9:05 AM, Shakna Israel wrote:
>
> I'm trying to introduce an implicit binding for require.
>
> One of the features I love about Python, is the namespace binding.
>
> import sys
>
> sys.stdout.write("Sweet")
>
> I know this can also be accomplished
4 matches
Mail list logo