Re: [racket] image equality and evaluators

2012-02-11 Thread Nadeem Abdul Hamid
Nice - this is useful to me too, thanks very much. FWIW, instead of make-base-namespace I had to use make-gui-namespace to avoid a "cannot instantiate `racket/gui/base' a second time in the same process" error. On Thu, Feb 9, 2012 at 10:15 PM, Robby Findler wrote: > On Thu, Feb 9, 2012 at 9:

Re: [racket] image equality and evaluators

2012-02-09 Thread Jordan Johnson
Sweet. I'll try that out when I get back to the machine tomorrow. Thanks for the speedy help! Best, jmj -- Sent from my Android phone with K-9 Mail. Robby Findler wrote: On Thu, Feb 9, 2012 at 9:12 PM, Eli Barzilay wrote: > The other way is what gets you what you want: you need to use > `sa

Re: [racket] image equality and evaluators

2012-02-09 Thread Robby Findler
On Thu, Feb 9, 2012 at 9:12 PM, Eli Barzilay wrote: > The other way is what gets you what you want: you need to use > `sandbox-namespace-specs' to make the sandbox share an instance of the > necessary modules between your own code and the sandbox, so that > structs in the sandbox are the same type

Re: [racket] image equality and evaluators

2012-02-09 Thread Robby Findler
The structs that are used to represent images are generative and you're getting two different versions of them, one inside the sandbox and one outside. You could do the equality comparison inside the sandbox (the notion of booleans is shared between the sandbox and the outside, unlike images). You

Re: [racket] image equality and evaluators

2012-02-09 Thread Eli Barzilay
20 minutes ago, Jordan Johnson wrote: > But the REPL renders (ev '(rectangle 2 2 'solid 'blue))) as a > picture of a tiny rectangle, as I would expect. > > How is the above exposing the difference between image=?'s > perception of an image, and the object implementing the image? My guess is that

[racket] image equality and evaluators

2012-02-09 Thread Jordan Johnson
Hi all, Definitions: #lang racket (require racket/sandbox lang/imageeq) (define ev (make-evaluator '(special beginner) #:requires '(2htdp/image))) Interactions: > (image? (ev '(rectangle 2 2 'solid 'blue))) #f > (image=? (ev '(rectangle 2 2 'solid 'blue)) >