Re: [racket] how to stop canvas% from refreshing after on-event

2013-02-14 Thread Matthew Flatt
At Mon, 11 Feb 2013 16:41:15 +0100, Philipp Dikmann wrote: > It appears that the GUI canvas% refreshes itself whenever it receives a > mouse-event%. > I intend to refresh the canvas at a steady pace (using a timer%) and > independently of any mouse-events instead. > Is there a reasonable way to s

Re: [racket] current-subprocess-custodian-mode

2013-02-14 Thread Matthew Flatt
At Thu, 14 Feb 2013 13:42:38 +, Norman Gray wrote: > (parameterize ((current-subprocess-custodian-mode #f)) > [...]) > > I get an error "current-subprocess-custodian-mode: expects argument of type > <'interrupt, 'kill, or #f>; given: #f". Repair pushed to the git repo. Thanks for that repo

Re: [racket] Access c based dll through ffi

2013-02-14 Thread Danny Yoo
the errno are not so descriptiv. By the way, how can I make a printf in dll visible through rackets ffi. When I make this for my function > > (define-dreamlog DisplayHelloFromDLL (_fun -> (r : _void))) > > and eval (DisplayHelloFromDLL) > > I get nothing or I rewrite the function which returns a c

Re: [racket] Question about hash table efficiency

2013-02-14 Thread Matthew Flatt
Last time I looked at that benchmark, I changed the hash table to hold boxed values, so that the updating `hash-ref' plus `hash-set!' could be replaced with `hash-ref', `unbox' (which is fast), and `set-box!' (which is also fast). To confirm other comments: `hash-update' is implemented as just `ha

Re: [racket] scribble error

2013-02-14 Thread Jon Rafkind
Yes, that fixed it. Also I tried what Robby suggested, and that worked too. On 02/14/2013 01:05 PM, Matthew Flatt wrote: > I don't know whether it will solve your problem, but a cross-device > issue could be real for some users, so I've changed `net/ftp' to download > to the same directory as the

Re: [racket] scribble error

2013-02-14 Thread Matthew Flatt
I don't know whether it will solve your problem, but a cross-device issue could be real for some users, so I've changed `net/ftp' to download to the same directory as the destination path. At Thu, 14 Feb 2013 13:56:37 -0600, Robby Findler wrote: > You can just put the llncs2e.zip into the right pl

Re: [racket] login to a site

2013-02-14 Thread Hendrik Boom
On Thu, Feb 14, 2013 at 06:06:44AM -0700, Jay McCarthy wrote: > The answer to this question depends entirely on the site. Most sites > will have an HTML form which expects you to send the credentials to > via the query string or maybe post data. The response is likely to > contain a cookie, in its

Re: [racket] scribble error

2013-02-14 Thread Robby Findler
You can just put the llncs2e.zip into the right place and then scribble won't try to download it anymore. I forget if you have to unpack it first, but a quick peek at the source should fill you in (in the error message). On Thu, Feb 14, 2013 at 1:49 PM, Jon Rafkind wrote: > Strange scribble err

Re: [racket] scribble error

2013-02-14 Thread Jon Rafkind
Also, this is with the latest git as of right now: 294bed209ed903e9ac97095c369edfc9d01ff555 On 02/14/2013 12:49 PM, Jon Rafkind wrote: > Strange scribble error today. I haven't debugged it much yet, in case someone > has an idea of whats going on. > > $ scribble --pdf main.scrbl > File not found

[racket] scribble error

2013-02-14 Thread Jon Rafkind
Strange scribble error today. I haven't debugged it much yet, in case someone has an idea of whats going on. $ scribble --pdf main.scrbl File not found: /home/jon/.racket/llncs.cls Downloading via ftp://ftp.springer.de/pub/tex/latex/llncs/latex2e/llncs2e.zip... rename-file-or-directory: cannot re

Re: [racket] Question about hash table efficiency

2013-02-14 Thread Ray Racine
Also on more than one occasion I've had to work around issues with entry scaling with even mutable hashtables, A few 100K entries, they are fine but rapidly grind to a halt. The Python folks have hash tables nailed, über performance and scaling. On Thu, Feb 14, 2013 at 2:20 PM, James Bergstra w

Re: [racket] Question about hash table efficiency

2013-02-14 Thread James Bergstra
I was actually trying to understand the performance bottlenecks of the "knucleotide" challenge of the language shootout: http://benchmarksgame.alioth.debian.org/u64/program.php?test=knucleotide&lang=racket&id=4 Most of the time seems to be spent in the loop that builds the hash table. (Incidenta

Re: [racket] Question about hash table efficiency

2013-02-14 Thread Sam Tobin-Hochstadt
On Thu, Feb 14, 2013 at 2:15 PM, Robby Findler wrote: > Is this a bottleneck in some real program? Perhaps you'd share that (or some > inner loop of it)? I wonder if there is a better way to speed it up than > this. `hash-set!` (which, like `hash-update`, is written in Racket and hashes twice) is

Re: [racket] Question about hash table efficiency

2013-02-14 Thread Robby Findler
hash-update is defined in Racket and, besides the error checking, is basically the composition of those two functions. I expect it was written as something to abstract over a common pattern, not speed things up. Is this a bottleneck in some real program? Perhaps you'd share that (or some inner loo

Re: [racket] Question about hash table efficiency

2013-02-14 Thread J. Ian Johnson
If I am right, then it would make sense to use hash-update when the hash is big enough that a log-time traversal takes longer than a general procedure call's set-up and tear-down. -Ian - Original Message - From: James Bergstra To: J. Ian Johnson Cc: users@racket-lang.org Sent: Thu, 14

Re: [racket] Question about hash table efficiency

2013-02-14 Thread James Bergstra
Thanks, I suppose I just had my hopes up. I thought the more compact form might involve fewer expression evaluations and require just one hash lookup instead of two, and therefore might run something like twice as fast, rather than slightly slower. On Thu, Feb 14, 2013 at 1:36 PM, J. Ian Johnson

Re: [racket] Question about hash table efficiency

2013-02-14 Thread J. Ian Johnson
My guess would be the higher-orderness on hash-update causes the (minor) slowdown. -Ian - Original Message - From: James Bergstra To: users@racket-lang.org Sent: Thu, 14 Feb 2013 13:16:47 -0500 (EST) Subject: [racket] Question about hash table efficiency Hi list, just discovered racket a

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Galler
Jay and Robby, Thanks much. I found that discussion very helpful. R./ Zack Racket Users list: http://lists.racket-lang.org/users

Re: [racket] naming structs that are members of other structs

2013-02-14 Thread Matthias Felleisen
Whenever I encounter this situation, I tend to switch to Racket's class system: (define vehicle (class object% (define vehicle-state (class object% (field position ;; 3D point velocity ;; real ) ...)) (field state ;; vehicle-s

[racket] Question about hash table efficiency

2013-02-14 Thread James Bergstra
Hi list, just discovered racket and having fun learning about scheme again. Haven't used it since undergrad. Thanks! I was wondering about the efficiency of hash-update vs. hash-set and hash-ref. I thought the former would be faster, otherwise why have it? A little benchmark script reveals the sam

Re: [racket] sxml behavior: is this a bug?

2013-02-14 Thread John Clements
On Feb 13, 2013, at 9:47 AM, Danny Yoo wrote: >> The sentence: "Every child is unique; items never share their children >> even if the latter have the identical content." > > Looking at primary sources... Yup, the original specification: > >http://okmij.org/ftp/Scheme/SXML.html#SXML Tree >

[racket] today's Racket icon

2013-02-14 Thread Patrick Useldinger
Nice idea ;-) Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Jay McCarthy
Ah yes. We agree. I presume that Zack is concerned with the normal circumstance of running a racket program from the command line, but I recognize that you could do lots of creative things that will behave properly. Jay On Thursday, February 14, 2013, Robby Findler wrote: > That is also what I m

[racket] Catching Com exception

2013-02-14 Thread heraklea
Hello friends, how can I catch an com exception during execution of some com calls and how can I redirect the error messages. At the moment when a com exception occurs it is placed in Drracket. Yours, Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Robby Findler
That is also what I meant by code (well, I was speaking generally about all bytecode). The point I'm making is that this is not a limitation of our runtime system, it is just because you are imagining there are still references to that bytecode. In the specific instance you mention below, the nam

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Jay McCarthy
When I say "code", I mean module top-level binding byte-code. There's no way for Racket to remove (define (f x) (lambda (y) (printf "Gigantic string: ~a" (+ x y at the top-level. The byte-code will always contain the gigantic string. If you ever call f and get back something, that closure cou

[racket] current-subprocess-custodian-mode

2013-02-14 Thread Norman Gray
Greetings. I think that current-subprocess-custodian-mode may have some error in its argument-checking. If I evaluate the following in DrRacket: (parameterize ((current-subprocess-custodian-mode #f)) (subprocess (current-output-port) (current-input-port) (current-

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Robby Findler
I'm pretty sure code is collected in (regular) Racket. Small numbers aren't collected, true, but they also don't really take any space. Big numbers are collected, too. (I'm not sure about interned symbols.) Robby On Thu, Feb 14, 2013 at 7:26 AM, Jay McCarthy wrote: > In the Web server language,

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Jay McCarthy
In the Web server language, all anonymous functions are turned into top-level structures masquerading as functions where the fields are their free variables. For instance: (define (f x) (lambda (y) (+ x y)) becomes, roughly, (struct a-lambda42 (x) #:property prop:procedure (lambda (the-structu

Re: [racket] login to a site

2013-02-14 Thread Jay McCarthy
The answer to this question depends entirely on the site. Most sites will have an HTML form which expects you to send the credentials to via the query string or maybe post data. The response is likely to contain a cookie, in its headers, which you would include in the headers on future requests. J

Re: [racket] Access c based dll through ffi

2013-02-14 Thread heraklea
Hello Matthew, you are right. My RAcket is x64 but my dll is x86. That is the problem, but the errno are not so descriptiv. By the way, how can I make a printf in dll visible through rackets ffi. When I make this for my function (define-dreamlog DisplayHelloFromDLL (_fun -> (r : _void))) and

Re: [racket] Web-cells, anonymous functions, and garbage collection

2013-02-14 Thread Galler
Also, on further reflection, I'm happy to concede that my placing anonymous functions in a web-cell may not have been a great idea. If the ultimate answer is 'don't do that', that would be ok. Racket Users list: http://lists.racket-lang.org/users