Re: [racket] Sandboxed evaluation with 2htdp/image requires

2012-02-05 Thread Matthew Flatt
The `make-module-evaluator' function should attach an instance of `racket/gui/base' in its module's namespace to the newly created sandboxed namespace, but there is a problem... The decision of whether `racket/gui/base' is available is made through `gui-available?'. That the check happens once at

Re: [racket] Sandboxed evaluation with 2htdp/image requires

2012-02-05 Thread Nadeem Abdul Hamid
As a follow-up question, here is what I've been doing to load in student files, which may be either plain text files, or in the WXME format. (It used to work, but I guess not since the update to the GUI framework.) First, I use file->bytes to read in the bytes of their file. Then, given: data : b

[racket] Sandboxed evaluation with 2htdp/image requires

2012-02-05 Thread Nadeem Abdul Hamid
I'm having a problem with the error "cannot instantiate `racket/gui/base' a second time in the same process" in a script that I have to perform automated testing of student BSL programs. My script requires 2htdp/image for its own purposes and uses make-module-evaluator to create an evaluator for a

Re: [racket] Extract values from `time` function

2012-02-05 Thread Sam Tobin-Hochstadt
You want to use the `time-apply' function. The documentation is here: http://docs.racket-lang.org/reference/time.html?q=time-apply#%28def._%28%28quote._~23~25kernel%29._time-apply%29%29 In general, (time e) can be converted to (time-apply (lambda () e) '()), which produces values instead of print

Re: [racket] Extract values from `time` function

2012-02-05 Thread Asumu Takikawa
On 2012-02-05 16:27:17 +0100, Sergi Mansilla wrote: > I'd like to do that with the `time` function, but I can't figure out > how to extract the values it prints, since it doesn't seem to be a > return value. I am clearly missing something obvious. How can I use > values returned by `time`? `time`

[racket] Extract values from `time` function

2012-02-05 Thread Sergi Mansilla
Hi, For benchmarking purposes, I am running a function hundreds of times and want to make an average of the time it spends running. For that purpose I am now using `current-inexact-milliseconds` before and after he loop, and then subtracting both times and dividing by the iterations performed. I'

Re: [racket] Porter stemming algorithm

2012-02-05 Thread Phil Bewig
There are two stemmers on that page. I wrote the reference solution, but not the solution given in the comments. If it is the reference solution that is causing trouble, I am happy to help. Please tell me exactly what is going wrong. On Sun, Feb 5, 2012 at 2:42 AM, John Sampson wrote: > Hello -

[racket] Porter stemming algorithm

2012-02-05 Thread John Sampson
Hello - see http://programmingpraxis.com/2009/09/08/porter-stemming/ Regards _John Sampson_ On 04/02/2012 21:59, Danny Yoo wrote: Where's the source? On Feb 4, 2012 4:40 PM, "John Sampson" > wrote: Hello - I have found code for a Scheme version of the