What is this?
An interactive session for ghūl. Type a cell and run it: it is compiled on the server and runs in your browser, and whatever it defines stays available to the cells after it. A cell that ends on a value shows it.
This is for a line or a definition at a time. For a whole program, use the playground.
Running a cell
- Run, or Ctrl+Enter, Shift+Enter or Alt+Enter from anywhere in the cell, runs it.
- A line holding only
.runs what comes before it. - Enter on its own starts a new line.
- Alt+↑ and Alt+↓ bring back earlier cells.
Showing a value as the cell runs
display(value) shows a value where the cell has got to, rather
than only the value it ends on. display(value, "name") shows it
under a name, and update_display(value, "name") redraws it in place,
so a long-running cell can report its progress on one line.
A value that can draw itself - a Raster.IMAGE, say - is shown
as its picture, whether the cell ends on it or displays it.
Stopping and starting again
While a cell runs, Run becomes Stop, which ends a cell that will not finish. Code running in the browser cannot be interrupted, so the session goes with it and the next cell starts a new one. New session starts one on purpose.
Limits
A session holds 50 cells; when it is full, the next cell starts a new session. Cells are compiled on a shared server, so it limits how many one address can compile a minute.
While you type
Errors, hovers and completions come from the same analyser the playground uses, and know what the earlier cells defined.