Next: , Up: Utilities   [Contents][Index]


4.6.1 REPL

(use-modules (sly utils repl))

The Sly REPL is a cooperative REPL server that is integrated into the game loop. It is the key to live coding games with Sly. To connect to the REPL server, use the Geiser extension for GNU Emacs.

Scheme Procedure: start-sly-repl [port]

Start a cooperative REPL server that listens on the given port. By default, this port is 37146. Additionally, a process is scheduled to poll the REPL server upon every tick of the game loop.

The Sly REPL detects when the game loop throws an error and enters a special loop for debugging. When in this state, game state will not be updated or rendered. When the errors have been fixed, calling the resume-game-loop procedure will hand control back to the game loop.

Scheme Procedure: resume-game-loop

Abort from the error handling loop prompt and resume the game loop.