[plt-scheme] Repl during animation or simulation

From: Greg Santucci (thecodewitch at gmail.com)
Date: Wed Jun 3 23:26:31 EDT 2009

On Thu, Jun 4, 2009 at 1:48 PM, Ryan Culpepper <ryanc at ccs.neu.edu> wrote:

>
> It's easiest if you've already created a main function that starts all the
> work. Suppose it's called 'run-simulation'. Then instead of something like
> this
>
>  (run-simulation some-arguments)
>
> to start it in a new thread, write this instead:
>
>  (thread (lambda () (run-simulation some-arguments)))
>
> There are some distantly related examples of threads in "More: Systems
> Programming with PLT Scheme" in the help desk:
>
>  http://docs.plt-scheme.org/more/
>
> Ryan
>

Thank you very much for that! After RTFM, I found it there as well:
http://docs.plt-scheme.org/reference/threads.html#(part._.Creating_.Threads)

I've attached a version of gears.ss which allows you to do things like this
at the REPL:

(send c move-left)
(send c run)

Regards,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090604/d3e3b060/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gears.ss
Type: application/octet-stream
Size: 13414 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090604/d3e3b060/attachment.obj>

Posted on the users mailing list.