chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Live programming with Chicken


From: alex
Subject: Re: [Chicken-users] Live programming with Chicken
Date: Wed, 02 Jul 2014 12:01:12 -0700
User-agent: Roundcube Webmail/0.9.5

I have something like this set up on Unix. I start a separate SRFI-18 thread with a procedure that starts the main loop. Then (in the original thread) I call repl. The main loop calls thread-yield! after every iteration to make sure that the original thread evaluates each expression as soon as I press the return key.

I had some trouble with this last part at first: the original thread waited several seconds before evaluating my input. I think that the fix was nothing more than calling thread-yield! every loop iteration.

—Alex

On 2014-07-02 09:42, Richard wrote:
Thanks Kristian and Daniel,
Both options seem to be the thing I was looking for. I'll test them
both and see what I like best.
thanks,
Richard

On 07/02/14 17:43, Kristian Lein-Mathisen wrote:

Hi Pluizer,

I've tried to make a poll-based repl like you're talking about for the same purpose. Have a look here and see if that helps:

https://github.com/Adellica/prepl

K.


On Wed, Jul 2, 2014 at 12:40 PM, Richard <address@hidden <mailto:address@hidden>> wrote:

    Hello, I wanted to do some live game programming with Chicken
    Scheme. I would like to adjust my game whilst it is running a game
    loop. I tried srfi-18 threads for this but found it to be too
    unwieldy. So I wondered if there is a way to process the repl
    inside the loop. An example of what I would like:

    (let loop ()
            (process-repl) ; <- this
            (unless (do-game-stuff) (loop)))

    I could not find if anything like this exists. Does anybody know
    of a way?

    thanks,
    Pluizer

    _______________________________________________
    Chicken-users mailing list
    address@hidden <mailto:address@hidden>
    https://lists.nongnu.org/mailman/listinfo/chicken-users




_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]