To add a tiny bit to Neil's excellent explanation, in case it wasn't clear:
You can run your th.rkt program simply by doing
racket th.rkt
(That's probably all you need to know for now and for a small Racket program.)
You can make this start faster by byte-compiling th.rkt after you change it
Sergey Yudin wrote on 09/28/2015 09:08 AM:
By the way threads works but still output exists
#
#
How to suppess it ?
(void (thread ...))
You're seeing those messages because DrRacket likes to report the values
of top-level expressions as it evaluates them. But it doesn't report
anything wh
On Mon, Sep 28, 2015 at 2:05 AM, Neil Van Dyke wrote:
> Sergey Yudin wrote on 09/27/2015 04:50 PM:
>
>> Can you please explain whats wrong with the code ?
>>
>
> The program exits because the main thread exits, even though the
> "background" threads are still running.
>
> Add a `(sleep 30)` to th
Sergey Yudin wrote on 09/27/2015 04:50 PM:
Can you please explain whats wrong with the code ?
The program exits because the main thread exits, even though the
"background" threads are still running.
Add a `(sleep 30)` to the end of the file.
Neil V.
--
You received this message because you
Hello!
I am very new to Racket and trying to use some samples
file th.rkt
#lang racket/base
(thread (lambda ()
(for ([i 10])
(sleep 2)
(printf "thread 1\n"
(thread (lambda ()
(for ([i 20])
(sleep 1)
(printf "t
5 matches
Mail list logo