Re: [racket] image on frame

2013-04-23 Thread Laurent
It works for me (Ubuntu), replacing your pictures with strings, although the placement is probably not what you'd expect: it is not top-left-position based and the margin depends on the previous elements. You can put all the images inside a panel% instead of directly into the frame: all the contai

[racket] Why is this slow?

2013-04-23 Thread Jordan Schatz
I'm working through some programing puzzles, and one of them was to find the sum of all primes less the 2 million, the new math/number-theory collection (thanks Neil) makes it easy: #lang racket (require math/number-theory) ;;takes about 4 seconds (apply + (filter prime? (range 1 200))) Bu

Re: [racket] image on frame

2013-04-23 Thread Alan Johnsey
Thanks for this example. I'm trying to load multiple 50x50 ".bmp" images into a frame, specifying both the horizontal and vertical positions. Specifying the horiz-margin for a message works fine, but the vert-margin does not. Is this an error, or am I missing something? I'm using Racket 3.3. Samp

[racket] Racket and FPGA

2013-04-23 Thread Neil Van Dyke
Anyone have some neat Racket-based tools for FPGA development? I have a tentative FPGA project, for number-crunching, and almost certainly will be hand-tuning the HDL to squeeze every ounce of performance I can get, so I'm not interested right now in a Racket VM or a compiler. But if someone

Re: [racket] JSON module: why symbols for object keys? lists for arrays?

2013-04-23 Thread Erik Pearson
Thanks, Greg. Practical experience from a seasoned programmer is priceless. And so much depends on how you use the thing. A json object may be read, parsed, used for one value, thrown out. Or it may be stored in shared memory and used millions of times over months. One may decide to stick with the

[racket] replacing readline (Was: Can't delete chars in racket's terminal interpreter)

2013-04-23 Thread Neil Van Dyke
If some undergrad wants a fun one-week project to start the summer... Write a replacement for "readline" that can be used by the Racket command-line REPL. Two reasons: (1) avoid license and not-working-out-of-the-box issues with "readline"; (2) you can do cooler things, like auto-indent, par

Re: [racket] Evaluating pict to string

2013-04-23 Thread Sam Tobin-Hochstadt
Racket also uses complicated tricks with stack-copying to implemented continuations, which won't work in Emscripten. Sam On Tue, Apr 23, 2013 at 3:36 PM, Tony Garnock-Jones wrote: > On Apr 21, 2013, at 7:34 PM, Jason Yeo wrote: >> >> Has anyone tried compiling Racket to JavaScript using emscript

Re: [racket] JSON module: why symbols for object keys? lists for arrays?

2013-04-23 Thread Neil Van Dyke
General comments, which will be familiar to some... If one is being very performance-conscious -- which one likely would be, if one is writing server request-processing code -- then how best to parse and represent the JSON depends on how it'll be used. For example, for a large keyed-access co

Re: [racket] Can't delete chars in racket's terminal interpreter

2013-04-23 Thread Laurent
That was just a wild guess actually :) On Tue, Apr 23, 2013 at 8:38 PM, Ory Band wrote: > thanks. that did the trick :) > > they should add this to the docs somewhere. I looked all over the web for > this > > Ory Band - אורי בנד > > oryb...@gmail.com > OryBand.com , gplus.t

Re: [racket] Evaluating pict to string

2013-04-23 Thread Tony Garnock-Jones
On Apr 21, 2013, at 7:34 PM, Jason Yeo wrote: Has anyone tried compiling Racket to JavaScript using emscripten? (https://github.com/kripken/emscripten) Yep. I didn't get very far. The major obstacle was setjmp/longjmp. Emscripten didn't support these at the time, and there are/were also plent

Re: [racket] JSON module: why symbols for object keys? lists for arrays?

2013-04-23 Thread Greg Hendershott
I've used the JSON library with various web APIs and found the design decisions to make sense in practice. 1. Arrays vs. lists: In Racket lists are the de facto thing for this. Anyway, I don't think the objective of JSON is to be faithful to Javascript per se. (If it were, shouldn't the choice be

Re: [racket] Fwd: JSON module: why symbols for object keys? lists for arrays?

2013-04-23 Thread Matthias Felleisen
On Apr 23, 2013, at 1:11 PM, Erik Pearson wrote: > Something > like (require (for-interface net/ftp-interface "myftp.rkt")), so you > could just swap out myftp.rkt, or simplify to (require net/ftp) with > no changes to the dependent code. Funny that you mention this, we are thinking about this

[racket] Fwd: JSON module: why symbols for object keys? lists for arrays?

2013-04-23 Thread Erik Pearson
Ah, I see. The joy of using a language driven by educators (is the concise, literate, and patient communication!) The signature / unit stuff is indeed quite verbose and complex. Being an exploratory and somewhat experimental language, I've taken that as-is. I'm sure you guys have considered everyt

Re: [racket] Evaluating pict to string

2013-04-23 Thread John Clements
On Apr 21, 2013, at 7:34 PM, Jason Yeo wrote: > On Mon, Apr 22, 2013 at 9:26 AM, manu d wrote: >> I am trying to port TryClojure (https://github.com/Raynes/tryclojure), a >> web-based REPL, to Racket. > > Has anyone tried compiling Racket to JavaScript using emscripten? > (https://github.com/kr

Re: [racket] JSON module: why symbols for object keys? lists for arrays?

2013-04-23 Thread Matthias Felleisen
On Apr 23, 2013, at 12:14 PM, Erik Pearson wrote: > Thanks, I've started my signature/unit lesson now. It will take me a > couple of days absorbing the documentation and poring over the racket > usage to grasp it. The racket code has some really clean code that I > can actually follow (in areas

Re: [racket] Can't delete chars in racket's terminal interpreter

2013-04-23 Thread Neil Van Dyke
Ory Band wrote at 04/23/2013 12:14 PM: For example, when writing some chars and then hitting 'backspace', i get this instead of the last char being deleted: > abcd^H I'm using iTerm2 terminal app on Mac OSX Mountain Lion. Can you tell iTerm2 to send the Delete character when you press the

Re: [racket] Can't delete chars in racket's terminal interpreter

2013-04-23 Thread Laurent
Try to use readline: (require readline) Docs: http://docs.racket-lang.org/readline/ Laurent On Tue, Apr 23, 2013 at 6:14 PM, Ory Band wrote: > Hello. > > I can't seem to use the backspace key in racket's terminal interpreter. > > For example, when writing some chars and then hitting 'backspa

[racket] Can't delete chars in racket's terminal interpreter

2013-04-23 Thread Ory Band
Hello. I can't seem to use the backspace key in racket's terminal interpreter. For example, when writing some chars and then hitting 'backspace', i get this instead of the last char being deleted: > abcd^H I'm using iTerm2 terminal app on Mac OSX Mountain Lion. Any ideas how to fix this? T

Re: [racket] Getting unusual behavior from racket/sandbox: not truly capping memory usage?!

2013-04-23 Thread Robby Findler
Thanks. Lets not spend any energy pushing this in before it ripens. Robby On Tue, Apr 23, 2013 at 8:42 AM, Matthew Flatt wrote: > At Tue, 23 Apr 2013 08:32:38 -0500, Robby Findler wrote: > > When was the error introduced? > > Around 2003. > > > If it was before the last release, my > > default

Re: [racket] Getting unusual behavior from racket/sandbox: not truly capping memory usage?!

2013-04-23 Thread Matthew Flatt
At Tue, 23 Apr 2013 08:32:38 -0500, Robby Findler wrote: > When was the error introduced? Around 2003. > If it was before the last release, my > default would be to not include it. > > Robby > > On Tuesday, April 23, 2013, Matthew Flatt wrote: > > > At Mon, 22 Apr 2013 22:30:07 -0400, Neil Va

Re: [racket] Getting unusual behavior from racket/sandbox: not truly capping memory usage?!

2013-04-23 Thread Robby Findler
When was the error introduced? If it was before the last release, my default would be to not include it. Robby On Tuesday, April 23, 2013, Matthew Flatt wrote: > At Mon, 22 Apr 2013 22:30:07 -0400, Neil Van Dyke wrote: > > Matthew Flatt wrote at 04/22/2013 06:32 PM: > > > I've pushed a repair. >

Re: [racket] Getting unusual behavior from racket/sandbox: not truly capping memory usage?!

2013-04-23 Thread Matthew Flatt
At Mon, 22 Apr 2013 22:30:07 -0400, Neil Van Dyke wrote: > Matthew Flatt wrote at 04/22/2013 06:32 PM: > > I've pushed a repair. > > Will the repair be in 5.3.4? Pending. The repair isn't too complex, but it's not so trivial that I got it right on the first try --- a test run by DrDr exposed a p