[racket] static variables question

2012-02-17 Thread Joe Gilray
I've seen Eli's example of static variables on Stackoverflow, but I still need help. I've created a working sieve and now I want to wrap it in a manner that save primes to be used later. This is what I tried: ; wrapper function for sieve (define (primes-from-to start end) (let ([lastend 0] [st

Re: [racket] Computer Language Benchmark Game

2012-02-17 Thread Eli Barzilay
Yesterday, Isaac Gouy wrote: > Eli Barzilay writes: > -snip- > > > seems to be measuring gmp performance rather than racket's... > > > > Yes, it's unfortunate, but that's what practically everyone does. > > There's even a Racket program that doesn't use GMP! > > http://shootout.alioth.debian.or

[racket] Challenge: Game of life in 140 chars

2012-02-17 Thread Gary Baumgartner
Depending on taste, the live/die rule: (if (<= n 3 (+ n C)) 1 0) (if (<= 0 (- 3 n) C) 1 0) Racket Users list: http://lists.racket-lang.org/users

Re: [racket] To talk about Racket or not to talk about Racket (was Racket consultants)

2012-02-17 Thread Matthias Felleisen
These are great points to make to the wider community. Keep spreading them. As I am reading published books on other scripting languages (say Clojure), I am beginning to see that it's all about having a PL Kitsch [*] literature in your eco-system. And it has to start from just such stories, to

[racket] Scala macros

2012-02-17 Thread Asumu Takikawa
Hi all, So there's been quite a bit of discussion about macros in the Scala community recently and it turns out they have a proposal here: http://scalamacros.org/sips/macros.html The plan, AFAICT, is to have macros in Scala 2.10 (the next major version). Since it seems think they are accepting

Re: [racket] Computer Language Benchmark Game

2012-02-17 Thread Isaac Gouy
Eli Barzilay writes: -snip- > > seems to be measuring gmp performance rather than racket's... > > Yes, it's unfortunate, but that's what practically everyone does. There's even a Racket program that doesn't use GMP! http://shootout.alioth.debian.org/u32/program.php?test=pidigits&lang=racket&id

Re: [racket] Challenge: Game of life in 140 chars

2012-02-17 Thread Jeremiah Willcock
On Fri, 17 Feb 2012, Michael W wrote: Using vectors, this one's (life) function is about ~240 chars after compacting whitespace. ;; 8< ;; 8< ;; #lang racket (define glider '#(#(0 0 0 0 0 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0) #(0 0 0 0 1 0 0

Re: [racket] Challenge: Game of life in 140 chars

2012-02-17 Thread Michael W
Using vectors, this one's (life) function is about ~240 chars after compacting whitespace. ;; 8< ;; 8< ;; #lang racket (define glider '#(#(0 0 0 0 0 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0) #(0 0 0 0 1 0 0 0 0 0) #(0 0 0 0 0 1 0 0 0 0)

[racket] Challenge: Game of life in 140 chars

2012-02-17 Thread Michael W
Hey there! Inspired by this article, I tried (quite unsuccessfully) to make a very short, very contrived Game of Life just for fun. http://news.ycombinator.com/item?id=357938 How can we make this shorter? ; 8< ;; 8< ;; #lang racket (define glider '((0 0 0 0 0 0

Re: [racket] thread execution granularity?

2012-02-17 Thread Rüdiger Asche
sorry for the noise, I obviously misread the documentation. Thanks for the answers and polite reactions. - Original Message - From: "Robby Findler" To: "Rüdiger Asche" Cc: Sent: Friday, February 17, 2012 3:22 PM Subject: Re: [racket] thread execution granularity? I just tried this

Re: [racket] thread execution granularity?

2012-02-17 Thread Robby Findler
I just tried this program: #lang racket/base (define times '()) (define start (current-inexact-milliseconds)) (for ([x (in-range 10)]) (set! times (cons (- (current-inexact-milliseconds) start) times)) (sleep 0.01)) and times was bound to: '(90.0 80.0 70.0 60.0 50.0 40.0 30.0 20.0 10.0 0.0)

Re: [racket] thread execution granularity?

2012-02-17 Thread Matthew Flatt
At Fri, 17 Feb 2012 15:04:09 +0100, Rüdiger Asche wrote: > according to the Racket docs, the smallest amount of time a thread can > be put to sleep is 1 second. Because the argument to `sleep' is in seconds? The argument is a real number, so you can use `0.05' to request a 50-millisecond sleep.

[racket] thread execution granularity?

2012-02-17 Thread Rüdiger Asche
according to the Racket docs, the smallest amount of time a thread can be put to sleep is 1 second. I need a finer granularity than that... if I had access to the thread priority, I might just have the thread poll the timer on low priority, but I haven't found a way to do that. What I need

Re: [racket] Making a Racket function "recallable"

2012-02-17 Thread Eli Barzilay
Two days ago, Phil Bewig wrote: > You might be interested in SRFI-41 > . One of the examples is an > infinite stream of fibonacci numbers. Or in lazy racket, where that example becomes very clear: #lang lazy (define fibs (list* 1 1 (map + fibs (cdr fibs

Re: [racket] Anything happened with the bug report server?

2012-02-17 Thread Eli Barzilay
40 minutes ago, Dmitry Pavlov wrote: > Hello, > > I recently tried to submit a bug report about srfi/48. The system > tells me every time that it will send me an e-mail soon, and I have > not received any. I tried to search my bug on the site, and found > nothing, so I think it rejected my report

[racket] Anything happened with the bug report server?

2012-02-17 Thread Dmitry Pavlov
Hello, I recently tried to submit a bug report about srfi/48. The system tells me every time that it will send me an e-mail soon, and I have not received any. I tried to search my bug on the site, and found nothing, so I think it rejected my report for some reason. I tried yesterday and today, fr