[racket] Problem with places and sync/timeout

2012-03-13 Thread Tim Brown
Hello, I have written a number of programs that attempt to farm work out to a number of places... for example, the attached file which calculates the square of *ALL THE NUMBERS* between 0 and 99 inclusive! Intermittently, this pooling loop stops (usually at the last place)... e.g.

[racket] performance tuning summing a hash of vectors

2012-03-13 Thread Marijn
Hi, a program I'm working on uses hashes of vectors to organize data. The vectors are the same length and need to be summed over the hash keys. The obvious solution uses a double for loop: one for the keys of the hash and one over the vector indices. Thinking about it I decided that the most

[racket] accessing serial communications on Racket/Windows?...

2012-03-13 Thread Rüdiger Asche
Hello, Section 12.1.5 of the docs suggests that it should be possible to use file ports for accessing serial communications, such as (define-values (inport outport) (open-input-output-file com1)) That works, but inport #input-port:c:\personal\racket\v1.1\com1 and likewise outport

Re: [racket] accessing serial communications on Racket/Windows?...

2012-03-13 Thread Rüdiger Asche
Thanks, that sort of works, but only sort of... here is the portmon trace - it turns out that the open won't quite work, and nothing is output until the port is being closed - looks like some setup of the port is missing (eg setting output buffer size). Is there any more info available on

Re: [racket] accessing serial communications on Racket/Windows?...

2012-03-13 Thread Matthew Flatt
At Tue, 13 Mar 2012 17:00:12 +0100, Rüdiger Asche wrote: Hello, Section 12.1.5 of the docs suggests that it should be possible to use file ports for accessing serial communications, such as (define-values (inport outport) (open-input-output-file com1)) That works, but inport

Re: [racket] accessing serial communications on Racket/Windows?...

2012-03-13 Thread Matthew Flatt
At Tue, 13 Mar 2012 17:20:12 +0100, Rüdiger Asche wrote: Thanks, that sort of works, but only sort of... here is the portmon trace - it turns out that the open won't quite work, and nothing is output until the port is being closed - looks like some setup of the port is missing (eg

[racket] Sandbox needs to access preferences? Why?

2012-03-13 Thread Jordan Johnson
Hi all, I'm trying to write a checker script for the handin server (which is running on my Mac), and when i try handing an assignment in to it, I am getting the error that read access to my preferences file is denied: ERROR: file-or-directory-modify-seconds: 'read' access denied for

Re: [racket] Sandbox needs to access preferences? Why?

2012-03-13 Thread Eric Hanchrow
I've seen this occasionally too from rudybot; I'll see if I can get a stacktrace next time it happens (doubtful but you never know). On Tue, Mar 13, 2012 at 1:48 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Do you get a stacktrace with the error? Robby On Tue, Mar 13, 2012 at 3:06

Re: [racket] Sandbox needs to access preferences? Why?

2012-03-13 Thread Robby Findler
Yeah, I think it would help a lot to see the call to preferences:* and then we can figure out either how to eliminate it or to understand why it can't easily be eliminated and thus access should be granted or the library avoided or something else. Robby On Tue, Mar 13, 2012 at 4:29 PM, Eric

[racket] variadicnested for?

2012-03-13 Thread rob cook
I'd like to be able to create a nested for where the depth of nesting is determined dynamically. For example, instead of (for* ((a '(0 1)) (b '(0 1))) (printf ~v~v a b)) I could just say (myfor (2 '(0 1)) body with some means of extracting nested values). such that the above as (myfor (3

Re: [racket] variadicnested for?

2012-03-13 Thread J. Ian Johnson
What, like this? (define-syntax-rule (myfor bindings (arity rhs) body) (let ([bindings (make-vector arity)]) (let theloop ([i arity]) (cond [(zero? i) body] [else (for ([a rhs]) (vector-set! bindings (- arity i) a) (theloop (sub1

[racket] variadicnested for?

2012-03-13 Thread rob cook
To add to prior query - here's what I did, but I just think there *must* be a more elegant solution. (define (nestfor depth forclause todo) (define (nf depth forclause todo resultant) (for ((x forclause)) (if (= depth 1) (apply todo (append (list x) resultant)) (nf

Re: [racket] variadicnested for?

2012-03-13 Thread Matthias Felleisen
May I propose a slightly more useful macro instead: #lang racket (define-syntax (myfor stx) (syntax-case stx () [(_ (i ...) for-clause todo ...) #'(for* ([i for-clause] ...) todo ...)])) (define (nestfortest . args) (displayln args)) (myfor (a b c) '(1 2) (displayln `(,a

[racket] Mutually Recursive Struct:

2012-03-13 Thread Ray Racine
Does typed racket support mutually recursive structure definitions? (struct: A ([ b : B])) (struct: B ([a : A])) Thx, Ray Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Mutually Recursive Struct:

2012-03-13 Thread Ray Racine
Please ignore. Just not my day ... On Tue, Mar 13, 2012 at 8:29 PM, Ray Racine ray.rac...@gmail.com wrote: Does typed racket support mutually recursive structure definitions? (struct: A ([ b : B])) (struct: B ([a : A])) Thx, Ray Racket Users list:

[racket] CRLF indicator in bottom right of DrRacket

2012-03-13 Thread Harry Spier
Dear list members, When I open one of the files I'm editing in DrRacket there is a CRLF displayed with an orange background in the lower right side of DrRacket just before the current line and column numbers.. This only happens with this one file. When I open other files the CRLF indicator

Re: [racket] CRLF indicator in bottom right of DrRacket

2012-03-13 Thread Robby Findler
When you see that, it means that DrRacket is going to write the line breaks in the editor as \r\n instead of just using \n. DrRacket goes into that mode when it opens the file and finds a file that is both non-empty and all line breaks are \r\n line breaks (ie if there are both crlf and other

Re: [racket] variadicnested for?

2012-03-13 Thread rob cook
Thanks - did not post reply properly - this is very useful, as is the prior example in a different way (yours does not seem to allow the list of iteration variables to be provided dynamically, e.g., as a list, the prior has no such list, but I can index into the values). Both can fit my needs

Re: [racket] variadicnested for?

2012-03-13 Thread Eli Barzilay
You can do this without a macro: - (let loop ([depth 3] [l '()]) (if (zero? depth) (printf ~s\n (reverse l)) (for ([i 2]) (loop (sub1 depth) (cons i l) (0 0 0) (0 0 1) (0 1 0) (0 1 1) (1 0 0) (1 0 1) (1 1 0) (1 1 1) Or to get a list of

Re: [racket] variadicnested for?

2012-03-13 Thread Matthias Felleisen
myfor is 'dynamic' in that it expands to the desired depth but yes, I need to know the number at compile time. The advantage is that I get a variable list of my choice On Mar 13, 2012, at 10:00 PM, rob cook wrote: Thanks - did not post reply properly - this is very useful, as is the prior

Re: [racket] Sandbox needs to access preferences? Why?

2012-03-13 Thread Eli Barzilay
6 hours ago, Jordan Johnson wrote: Can you identify what may be triggering the attempt to read preferences, and how I can either avoid it or grant appropriate read permissions? Thanks... You can grant permissions with `sandbox-path-permissions' -- but note that this could be a security hole