Re: [racket-users] Making evaluators / handin server setup

2019-01-13 Thread Matthew Flatt
At Sat, 12 Jan 2019 13:53:59 -0800, Jordan Johnson wrote:
> Having downloaded Racket 7.1, I’m playing with evaluator-related code again 
> (for the first time since October), and now am seeing this behavior in 
> DrRacket:
> 
> > > (require racket/sandbox)
> > > (define e (make-evaluator 'lang/htdp-beginner))
> > . . ../../Applications/Racket v7.1/collects/pkg/private/lock.rkt:26:0: 
> directory-exists?: `exists' access denied for /Applications/Racket 
> v7.1/share/pkgs

I've pushed a repair for this additional problem to be included in the
v7.2 release.

It escaped attention earlier, because one facet of a development build
(from a Git checkout, which is how most of our testing is done) happens
to cancel out the problem.

Thanks for the report!
Matthew

-- 
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.


Re: [racket-users] Making evaluators / handin server setup

2019-01-12 Thread Jordan Johnson
Hi Matthew et al.,

Following up some work from last fall:

On Oct 6, 2018, at 15:58, Matthew Flatt  wrote:
> At Wed, 26 Sep 2018 15:57:12 -0700, Jordan Johnson wrote:
>>> (require racket/sandbox)
>>> (make-evaluator "beginner-lang.rkt")
>> . . ../../../../../../../../Applications/Racket 
>> v7.0/collects/racket/private/kw-file.rkt:102:2: open-input-file: `read' 
>> access 
>> denied for /Users/jteach/Library/Racket/7.0/pkgs/.LOCKpkgs.rktd
> 
> That was a problem with creating a sandbox in DrRacket, as opposed to
> `racket` at the command line or with the handin server. It's fixed for
> the next release.

Having downloaded Racket 7.1, I’m playing with evaluator-related code again 
(for the first time since October), and now am seeing this behavior in DrRacket:

> > (require racket/sandbox)
> > (define e (make-evaluator 'lang/htdp-beginner))
> . . ../../Applications/Racket v7.1/collects/pkg/private/lock.rkt:26:0: 
> directory-exists?: `exists' access denied for /Applications/Racket 
> v7.1/share/pkgs
> > 

Command-line `racket’ doesn’t exhibit this problem; it just creates the 
evaluator and lets me run with it. This is on Mac OS X (High Sierra, 10.13.4).

I’m posting here in case it’s the same as (or related to) the bug Matthew 
mentioned, meaning the bug wasn’t completely squashed the first time around. Is 
there another likely possibility I’m missing? Is there something more I can do 
to help diagnose what’s going on?

Thanks,
Jordan

-- 
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.


Re: [racket-users] Making evaluators / handin server setup

2018-10-06 Thread Matthew Flatt
At Wed, 26 Sep 2018 15:57:12 -0700, Jordan Johnson wrote:
> > (require racket/sandbox)
> > (make-evaluator "beginner-lang.rkt")
> . . ../../../../../../../../Applications/Racket 
> v7.0/collects/racket/private/kw-file.rkt:102:2: open-input-file: `read' 
> access 
> denied for /Users/jteach/Library/Racket/7.0/pkgs/.LOCKpkgs.rktd

That was a problem with creating a sandbox in DrRacket, as opposed to
`racket` at the command line or with the handin server. It's fixed for
the next release.


> In doing a trial run of submitting my test solutions, I found my checker.rkt 
> signaling errors from the check: form: Using :language '(special 
> htdp-beginner), I get an error from the student’s (require 2htdp/image) line, 
> saying that image? is being imported twice.

Long story short, this appears to be a bug in the sandbox evaluator
setup, too, also fixed for the next release.

A workaround is to use `'lang/htdp-beginner` as the language instead of
`'(special beginner)`. That happens to avoid a redundant and
troublemaking `require`.

Roughly, the problem was that with `'(special beginner)` or `'(lib
"lang/htdp-beginner.rkt")` the sandbox constructs a module that uses
the language --- but also `require`s the language. That redundancy is a
problem if there are bindings that other `require`s are intended to
shadow, such as `image?` shadowed by requiring `2htdp/image`.

-- 
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.


[racket-users] Making evaluators / handin server setup

2018-09-26 Thread Jordan Johnson
Dear Racketeers,

I’m writing about difficulties using make-evaluator in Racket v7.0 with a 
module that selectively (or not) re-exports bindings from an existing language. 
This is related to work I’m doing with the handin server.

- the short version -

Create this file, and use as follows:

; beginner-lang.rkt ;

#lang racket

(require lang/htdp-beginner)
(provide (all-from-out lang/htdp-beginner))

; Interactions, launched from the same directory: ;

> (require racket/sandbox)
> (make-evaluator "beginner-lang.rkt")
. . ../../../../../../../../Applications/Racket 
v7.0/collects/racket/private/kw-file.rkt:102:2: open-input-file: `read' access 
denied for /Users/jteach/Library/Racket/7.0/pkgs/.LOCKpkgs.rktd

; end code ;

Q: Can you tell me why I’m seeing this behavior?

- the longer version, with context -

After a couple years of just having my small classes email me their work, I’m 
trying the handin server again. For the next assignment, students are writing 
BSL code that uses 2htdp/image and the animate function from 2htdp/universe. 
Their code also uses bitmap/url to load an image I provided via the class 
website.

In doing a trial run of submitting my test solutions, I found my checker.rkt 
signaling errors from the check: form: Using :language '(special 
htdp-beginner), I get an error from the student’s (require 2htdp/image) line, 
saying that image? is being imported twice.

Q: How do I make the import “just work”, as it ordinarily does in DrRacket?

Going further, I’ve kludged together a wrapper lib that imports all the needed 
functions while taking care to remove clashes, at which point I got the odd 
read-access error above. Here’s that code:

; img.rkt ;

#lang racket

(require racket/require) ; for subtract-in

(require (combine-in [except-in lang/htdp-beginner require image?]
 [subtract-in [except-in 2htdp/image bitmap/url]
  lang/htdp-beginner]))
 
(provide (all-from-out lang/htdp-beginner)
 (all-from-out 2htdp/image)
 bitmap/url
 animate
 (rename-out [%require require]))

(define-syntax-rule (%require . blahblah) (void)) ; ignore student's requires

(define (animate _) (void)) ; ignore student's calls to animate from universe

(define (bitmap/url url) ; replace bitmap/url with something harmless
  (rectangle 50 35 'solid 'lavender))

; end img.rkt; I am using it in checker.rkt as follows: ;

(check: :language "../../img.rkt"  ; escape to assignment base dir
...)

; end ;

This approach works for now, but seems like an ungainly way to do it, and I’ll 
be surprised if this level of manual disambiguation is what everybody’s been 
doing for years. Is there a more elegant way?

Best,
Jordan

-- 
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.