Re: [racket] Typed racket and keywords

2013-02-20 Thread Neil Toronto
Well, you can't do it like that, but you can like this: #lang typed/racket (: test0 (Integer [#:zero Integer] -> Boolean)) (define (test0 x #:zero [v 0]) (= x v)) I think the `Keyword' type is for symbols that happen to be keywords: (cast '#:zero Keyword) I believe there is currently no w

Re: [racket] Math library kudos

2013-02-20 Thread Joe Gilray
Hi Jens, You are probably right (no pun intended!), but I was only looking at the docs and since prime-strong-pseudo-single? is unexported and not in the docs, I didn't see it. I may not fully understand your code, but where do you put in the number of trials (it is not in the signature of prime-

[racket] Typed racket and keywords

2013-02-20 Thread Norman Gray
Greetings. Should I be able to specify a function which can take keywords, in Typed Racket? The 'define:' form suggests not, and an experiment with: (define test0 (case-lambda: (((x : Integer)) (= x 0)) (((x : Integer) (k : Keyword) (v : Integer)) (begin (

Re: [racket] Math library kudos

2013-02-20 Thread Jens Axel Søgaard
Hi Joe, 2013/2/20 Joe Gilray : > Racketeers, > > Thanks for putting together the fantastic math library. It will be a > wonderful resource. Here are some quick impressions (after playing mostly > with math/number-theory) > > 1) The functions passed all my tests and were very fast. If you need e

Re: [racket] Access c based dll through ffi

2013-02-20 Thread Danny Yoo
On Wed, Feb 20, 2013 at 7:01 AM, Matthew Flatt wrote: > If you load this DLL via DrRacket, then you won't see output, because > stdout isn't connected to anything in particular in a GUI appplication. > That is, stdout at the C level is not redirected to the Racket current > output port. That bei

Re: [racket] Math library kudos

2013-02-20 Thread Luke Vilnis
I did a google search for log-gamma and then browsed around the documentation. I think the issue is I was poking through the "Special Functions" and statistics functions sections, but the binomial stuff is under the "flonum" section, even though fllog-gamma can be found in "Special Functions." May

Re: [racket] raco setup and compile-collection-zos

2013-02-20 Thread Laurent
On Wed, Feb 20, 2013 at 3:06 PM, Matthew Flatt wrote: > The problem is that DrRacket sets various other parameters that affect > compilation --- so that the programs you run within DrRacket get > automatically compiled, for example. > > It's possible that things used to work back before `Populate

Re: [racket] Math library kudos

2013-02-20 Thread Neil Toronto
You're welcome! A user not finding a documented function is excellent feedback. It means we need to communicate better. Do you remember how you searched for a combinations function? Neil ⊥ On 02/20/2013 08:45 AM, Luke Vilnis wrote: Ha! Sorry for not reading the documentation more thoroughly

Re: [racket] Math library kudos

2013-02-20 Thread Luke Vilnis
Ha! Sorry for not reading the documentation more thoroughly - I hope this was at least a bit educational to someone besides me :) Fantastic library and docs, by the way. On Wed, Feb 20, 2013 at 10:38 AM, Neil Toronto wrote: > On 02/20/2013 06:42 AM, Luke Vilnis wrote: > >> No problem. They should

Re: [racket] Math library kudos

2013-02-20 Thread Neil Toronto
On 02/20/2013 06:42 AM, Luke Vilnis wrote: No problem. They should be faster even for fairly small numbers since they usually require the evaluation of a polynomial (an approximation of (log)gamma) versus repeated multiplication/division. From memory the code should be something like: (exp (fllo

Re: [racket] Math library kudos

2013-02-20 Thread Neil Toronto
On 02/19/2013 05:28 PM, Joe Gilray wrote: Racketeers, Thanks for putting together the fantastic math library. It will be a wonderful resource. Here are some quick impressions (after playing mostly with math/number-theory) The thanks in this case goes to Jens Axel, who wrote almost all of the

Re: [racket] Access c based dll through ffi

2013-02-20 Thread Matthew Flatt
If you load this DLL via DrRacket, then you won't see output, because stdout isn't connected to anything in particular in a GUI appplication. That is, stdout at the C level is not redirected to the Racket current output port. If you use a command shell, run plain Racket, and then call the DLL, th

Re: [racket] raco setup and compile-collection-zos

2013-02-20 Thread Matthew Flatt
The problem is that DrRacket sets various other parameters that affect compilation --- so that the programs you run within DrRacket get automatically compiled, for example. It's possible that things used to work back before `Populate "compiled" directories' was on by default in DrRacket, and turni

Re: [racket] Catching Com exception

2013-02-20 Thread Matthew Flatt
At Tue, 19 Feb 2013 13:36:17 +0100, herak...@gmx.de wrote: > is this the right direction? > > (with-handlers ([exn:fail? (lambda (exn) (printf "com-exp-file-exists"))]) > (set! Object (com-invoke COMOBJ "Method1" 2))) Assuming that you want to catch exceptions that are raised by "

Re: [racket] list-box%

2013-02-20 Thread Matthew Flatt
At Wed, 20 Feb 2013 11:48:02 +0100, herak...@gmx.de wrote: > is there a method to adjust columns to contents in list-box% object?? > > I search in the docs, but I cannot find such method with similar > functionality. There's currently no method to make a column's width match the width of the colu

Re: [racket] Math library kudos

2013-02-20 Thread Haiwei Zhou
Hi Joe, There is a straight way to calculate product. (define (combinations n r) (/ (for/product ([i (in-range n (- n r) -1)]) i) (for/product ([i (in-range r 1 -1 )]) i))) Regards, haiwei On 20 February 2013 14:44, Joe Gilray wrote: > Hi Luke, > > Thanks for the knowledge. Do you ha

Re: [racket] Math library kudos

2013-02-20 Thread Luke Vilnis
No problem. They should be faster even for fairly small numbers since they usually require the evaluation of a polynomial (an approximation of (log)gamma) versus repeated multiplication/division. From memory the code should be something like: (exp (fllog-gamma (+ 1.0 n)) - (fllog-gamma (+ 1.0 r))

Re: [racket] Rosetta Code

2013-02-20 Thread Matthias Felleisen
By all means do so. Thank you -- Matthias On Feb 20, 2013, at 7:50 AM, Tim Brown wrote: > On 19/02/13 00:33, Matthias Felleisen wrote: >> >> Yes, that's the conclusion they come to but did they act on it? > > I suspect that with it being a Wiki in nature, any amount of discussion > can go on

[racket] "The Racket Reference" PDF first page ugliness

2013-02-20 Thread Tim Brown
Folks, I usually read the documentation for racket in the scribbled HTML form. But today, I needed to print something from the PDF, which I find better laid out for paper. So I went to http://pre.racket-lang.org/docs/pdf/reference.pdf and noticed that the first page has a "margin-note" which jus

Re: [racket] Rosetta Code

2013-02-20 Thread Tim Brown
On 19/02/13 00:33, Matthias Felleisen wrote: Yes, that's the conclusion they come to but did they act on it? I suspect that with it being a Wiki in nature, any amount of discussion can go on around the Village Pump (or whatever), but it's up to the contributors themselves to "act on it" themse

[racket] list-box%

2013-02-20 Thread heraklea
Hello friends, is there a method to adjust columns to contents in list-box% object?? I search in the docs, but I cannot find such method with similar functionality. Yours, Racket Users list: http://lists.racket-lang.org/users