I'm concerned about this:
+[sandbox-namespace-specs
+ (cons (λ () (namespace-anchor->namespace anchor))
It seems like this would cause all evaluators to share a single
namespace, if I'm reading the docs right. (That would be a good test to
add.) Why not
> Do you need to do the same thing with file/convertible?
The current version only attaches file/convertible.
>
> Robby
>
>
> On Thu, Oct 3, 2013 at 1:09 PM, Stephen Chang wrote:
>>
>> Here's another attempt at a patch. Would someone mind code reviewing it?
>>
>> Ryan pointed me towards sandbox
Do you need to do the same thing with file/convertible?
Robby
On Thu, Oct 3, 2013 at 1:09 PM, Stephen Chang wrote:
> Here's another attempt at a patch. Would someone mind code reviewing it?
>
> Ryan pointed me towards sandbox-namespace-specs and it seems to do the
> trick. I also added some te
Here's another attempt at a patch. Would someone mind code reviewing it?
Ryan pointed me towards sandbox-namespace-specs and it seems to do the
trick. I also added some tests and the docs seem to compile ok.
On Wed, Oct 2, 2013 at 7:21 PM, Robby Findler
wrote:
> namespace-attach-module sets up s
namespace-attach-module sets up shared state between two modules so that,
in this case, the racket/pretty in one namespace is the same as the
racket/pretty in the other.
Try putting a printf in the top-level of racket/pretty (and in various
other places in that code as it does what it does) and th
Ok here's another dumb question. Why is that namespace-attach-module
even needed? It seems the dynamic require on the next line does the
desired thing?
On Wed, Oct 2, 2013 at 4:16 PM, Stephen Chang wrote:
> Ok thanks for the explanations. I'll try doing one of the last two
> suggestions.
>
> On
Ok thanks for the explanations. I'll try doing one of the last two suggestions.
On Wed, Oct 2, 2013 at 4:09 PM, Ryan Culpepper wrote:
> No, the 'racket/pretty' module might be declared even if the symbol isn't
> defined (or "mapped") in the namespace:
>
> > (define ns (make-base-namespace))
>
No, the 'racket/pretty' module might be declared even if the symbol
isn't defined (or "mapped") in the namespace:
> (define ns (make-base-namespace))
> (define repl-ns (current-namespace))
> (parameterize ((current-namespace ns))
(eval '(require (only-in racket/pretty
> (parame
Right, exactly.
Which is why Ryan's earlier suggestions are better: You can avoid all this
mess.
Robby
On Wed, Oct 2, 2013 at 2:59 PM, Ryan Culpepper wrote:
> Yes. Also, it's not enough to check that 'racket/pretty' (or really, the
> name 'racket/pretty' resolves to) isn't declared in the tar
Yes. Also, it's not enough to check that 'racket/pretty' (or really, the
name 'racket/pretty' resolves to) isn't declared in the target
namespace; you must also check any module it (transitively) requires is
either undeclared or was attached from the same namespace you want to
attach racket/pre
> A namespace is a mapping from top-level identifiers to whatever they are, as
> well as a separate mapping from module names to modules (roughly). What you
> care about here is the second mapping, but you're checking the first with
> the patch.
Thanks for the explanation. That helps a lot. So the
A namespace is a mapping from top-level identifiers to whatever they are,
as well as a separate mapping from module names to modules (roughly). What
you care about here is the second mapping, but you're checking the first
with the patch.
Robby
On Wed, Oct 2, 2013 at 2:45 PM, Stephen Chang wrote
> Whether that identifier exists in the namespace has nothing to do with
> whether racket/pretty can be attached.
Can you explain this a little more because it's a little unintuitive to me?
>
> One option would be for install-pretty-printer! to just catch and discard
> the error. Evaluators for
The last two sound better than the others to me, FWIW.
Robby
On Wed, Oct 2, 2013 at 2:37 PM, Ryan Culpepper wrote:
> On 10/02/2013 03:19 PM, Stephen Chang wrote:
>
>> Can I push the attached (1-line) patch? I don't have a good grasp of
>> namespaces so I would like someone to review it first.
On 10/02/2013 03:19 PM, Stephen Chang wrote:
Can I push the attached (1-line) patch? I don't have a good grasp of
namespaces so I would like someone to review it first.
Right now, make-base-eval tries to attach racket/pretty to the
namespace regardless of whether it's already there, which someti
Can I push the attached (1-line) patch? I don't have a good grasp of
namespaces so I would like someone to review it first.
Right now, make-base-eval tries to attach racket/pretty to the
namespace regardless of whether it's already there, which sometimes
results in an exception (for example if the
16 matches
Mail list logo