Re: [racket] lambda as default value to dict-ref

2013-02-15 Thread Jos Koot
If the failure-result is a procedure, it is called without arguments. I quote part of the doc: quote •If failure-result is a procedure, it is called (through a tail call) with no arguments to produce the result. endquote Jos -Original Message- From: users-boun...@racket-lang.org [mailto:

Re: [racket] lambda as default value to dict-ref

2013-02-15 Thread Matthew Flatt
If the third argument to `dict-ref' (and `hash-ref') is a function, then the function is called as a failure thunk. If the third argument is any other kind of value, then the value is returned as the result in case of failure. This is convenient but, yes, potentially confusing. If you want a defa

[racket] lambda as default value to dict-ref

2013-02-15 Thread J G Cho
So, I have a dict A that looks like (list ("string as key" . (lambda (arg) ...) ...) I do ((dict-ref A key (lambda (_) "wrong key")) some-params). When keys are valid the above work as expected. When the key does not find any, I was expecting ((lambda (_) "wrong key") some-params) but it fails w

Re: [racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Galler
Matthew and Ryan and Robby, MAJOR COLLECTIONS WITHOUT ACTIVITY The issue regarding major collections occuring with no activity was due to the collect function executing in lru.rkt on a timer. Now no activity equals no collections. Thanks Ryan. BACKGROUND AND NEXT QUESTION Purpose of fo

Re: [racket] gauge% set-range

2013-02-15 Thread Matthew Flatt
At Fri, 15 Feb 2013 17:52:59 +0100, herak...@gmx.de wrote: > the maximum number for the range is internally not accepted. When I enter > 10 in my loops textfield(see attached gui app) I get an > > set-value in gauge%: contract violation > expected: (integer-in 0 1) > given: 10001 >

Re: [racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Matthew Flatt
At Fri, 15 Feb 2013 16:55:09 -0500 (EST), Galler wrote: > Matthew, > > > A major collection is triggered when current memory use is twice > > the use at the last major collection. > > I'm not following this sentence, as it implies logarithmic growth in > memory, which is not observed.

Re: [racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Galler
Matthew, A major collection is triggered when current memory use is twice the use at the last major collection. I'm not following this sentence, as it implies logarithmic growth in memory, which is not observed. At some point in the executable's life, the major GC cycles consistently occur

Re: [racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Galler
Matt, Ryan Thanks very much for the answers, let me think about. I'm looking at the issue Ryan brings up with module references to lru.rkt, which surprised me. R./ Zack On Fri, Feb 15, 2013 at 2:39 PM, Matthew Flatt wrote: At Fri, 15 Feb 2013 14:16:38 -0500 (EST), Galler wrote: When an app

[racket] Racket v5.3.3

2013-02-15 Thread Eli Barzilay
Racket version 5.3.3 is now available from http://racket-lang.org/ This is a bug-fix release to address a flaw in DrRacket v5.3.2 concerning interactions between the contour window and the syntax coloring. Feedback Welcome, -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Bar

Re: [racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Ryan Culpepper
I think the periodic two major collections are coming from the default servlet "manager", which defaults to a manager created by make-threshold-LRU-manager. (See the two calls to (collect-garbage) in web-server/managers/lru.rkt). Ryan On 02/15/2013 02:16 PM, Galler wrote: Dear Racketeers,

Re: [racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Matthew Flatt
At Fri, 15 Feb 2013 14:16:38 -0500 (EST), Galler wrote: > When an application is compiled and run, the garbage collector in v5.3.2 > appears to run through a number of minor collection cycles, then will > execute two sequential major cycles, in rapid succession. > > [...] > > 1) Why are two suc

[racket] Yet another garbage collection question: major GC cycles

2013-02-15 Thread Galler
Dear Racketeers, *SMALL PREAMBLE* I'm trying to understand the observed GC behavior so I can create better application performance, and I'm focusing on the major GC-cycle. For usability, my desire would be to have a major-garbage-collection cycle last about the same time as a typical request

Re: [racket] [Racket] Making Racket find files

2013-02-15 Thread Philipp Dikmann
And if you're still left wanting to find system/user specific paths, find-system-path has you covered (http://docs.racket-lang.org/reference/Filesystem.html). On 15.02.13 16:07, Sam Tobin-Hochstadt wrote: When you write something like this: #lang racket (require "myfile.rkt") and r

[racket] gauge% set-range

2013-02-15 Thread heraklea
Hello friends, the maximum number for the range is internally not accepted. When I enter 10 in my loops textfield(see attached gui app) I get an set-value in gauge%: contract violation expected: (integer-in 0 1) given: 10001 Yours, guithread.rkt Description: Binary data _

Re: [racket] [Racket] Making Racket find files

2013-02-15 Thread Sam Tobin-Hochstadt
When you write something like this: #lang racket (require "myfile.rkt") and run that, it looks for "myfile.rkt" in the same directory that the file you are running is in. If you're running racket at a command line, like this: % racket.exe "myfile.rkt" then racket looks for "myfile.rkt"

[racket] [Racket] Making Racket find files

2013-02-15 Thread John Sampson
On Feb 1 I wrote: "I have not been able to find a succinct description how to cope with the Windows directory system to make Racket find user-created files, either to run them as programs or open them as data sources or destinations. Perhaps there is a particular directory where they have to

Re: [racket] Racket 5.3.2 Error, when open file/tab

2013-02-15 Thread Robby Findler
Hi Martin: sorry about that bug. We are preparing a release to address this problem that should be out shortly (watch this space for announcements). In the mean time, close the contour window and the problem should go away. Apologies, Robby On Fri, Feb 15, 2013 at 3:35 AM, Martin Saurer wrote:

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

2013-02-15 Thread Thomas Chust
On Fri, 15 Feb 2013, Norman Gray wrote: On 2013 Feb 15, at 00:30, Matthew Flatt wrote: At Thu, 14 Feb 2013 13:42:38 +, Norman Gray wrote: [...] What I _want_ to do here is basically execv(3) vi from a Racket program. [...] The `system' function uses threads as needed to pump from non-f

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

2013-02-15 Thread Norman Gray
Matthew, hello. On 2013 Feb 15, at 00:30, Matthew Flatt wrote: > 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,

[racket] Racket 5.3.2 Error, when open file/tab

2013-02-15 Thread Martin Saurer
Dear Racketeers When enabled the "Open files in separate tabs ." setting, Racket fails to open a file, with the following error message: sequence-contract-violation: negative: method end-edit-sequence cannot be called, except in states (in-edit-sequence) context...: C:\Program Files\Racket