Editor and REPL
The editor shows one database. Its header holds the Saka logo, which returns home, the database’s title, and the menus File, Edit, View, and Help. Help opens this documentation, explains limits, and checks for updates.
Sidebars
Section titled “Sidebars”The rail at the far left chooses a sidebar; point at an icon to see its name. Click an item to show or hide its sidebar:
- Declarations: browse your declarations and the standard library’s. The editor opens on this sidebar.
- Files: read the sources of your files and of the standard library.
- Views: open query views.
- Debug: open the Task Manager or Undo History.
Shell opens the REPL. Drag a sidebar’s edge to resize it. On a narrow screen, a sidebar opens over the documents; tap beside it to close it.
Documents, tabs, and splits
Section titled “Documents, tabs, and splits”Documents open in tabs. A single click on a source opens a preview with an italic title, which the next document you open replaces. Double-click to keep it open.
A source shows a file’s declarations as the database holds them, without comments, so it can differ from what you typed. Sources are read-only and stay as they were when the data changes; Refresh reads one again.
Right-click a tab to close tabs or to split a document into another pane. Drag tabs to rearrange them or to move them between panes.
Reloading the page clears its tabs and your own query views; role views return. Reloading the only Saka tab can also discard your databases; see Databases.
The Editor and REPL panel
Section titled “The Editor and REPL panel”The panel below the documents has two tabs:
- Editor: edit a query’s formula with more room, or read a cell’s whole value.
- REPL: enter declarations, expressions, and changes. Enter runs your entry, and Alt+Enter adds a line. Up and Down at the ends of the entry recall earlier entries.
View opens either tab. Ctrl+` opens the REPL on every platform, macOS included, and hides the panel when the REPL is already shown. Hiding the panel keeps your formula draft and REPL history.
Each browser tab has its own REPL, and all of them work on the same database. Clear REPL clears the output. Restart REPL, or Ctrl+], also clears its history and draft, and leaves the database as it is.
REPL commands
Section titled “REPL commands”Commands that start with a colon control the REPL:
| Command | What it does |
|---|---|
:modules |
list the database’s files |
:module "main.saka" |
switch to a file |
:create "pricing.saka" |
create an empty file and switch to it |
:drop-module "pricing.saka" |
remove a file |
:source |
print the current file’s declarations |
:observe name |
print a declaration’s result, then what changes in it after each change |
:cancel name |
stop observing |
:undo, :redo |
undo or redo the last change; see Undo and redo |
:reset |
empty the database for every tab, without asking |