"strings" are detected
semicolons are printed lighter
$[cond;a;cond;b;else] marks conditions differently
$[cond;a;cond;b] indicates an error for missing else
1+ \x highlights debug backslash
(} are marked as errors
run restarts k and evaluates the program in the editor.
the same can be done with
shift-rightclick in the editor.
if some text is selected, these shortcuts only send the current selection to the repl, without restarting k.
clicking an a line number executes that line only.
k a.k b.k executes
b.k followed by the program in the editor.
the repl shows k output and remains active after running the program in the editor.
k output lines also keep a reference to the underlying k value. hovering over an output line displays it in red and shows the type information. double-clicking on it resends it to the input and right-clicking assigns it to
text that is written by k with
x+ \y keeps track of the stores the source location in the output.
it is shown in red and double-clicking points the editor to the source where the write call originates.
(1+)/:1), it can be interrupted with the
int button, which is enabled when k is busy.
int terminates and restarts the webworker.
all data in k memory is reset, but the filesystem in the ui is still loaded.
by default you can edit and execute the contents of the editor.
to load files from disk, you can open a directory by clicking
only one directory is supported, no subdirs.
the filesystemapi is not supported by all browsers.
otherwise drop files or a directory in the window.
click on a file to open it in the editor.
put writes it back to disk or downloads.
the browser highlights the open file
underlines modified files that have not been written.
it does not track changes happening on disk.
`file<"bytes" writes to disk and
`$<`"." returns a list of all file names as symbols.
rda or when the file has been opened in the editor.
k-files are always preloaded.
entering text in the the input field of the file browser searches for the input text in all loaded files and prints links for all matches in the console (like grep but no regex).
search in the editor by selecting text and right click to jump to the next occurance.
find files by entering a prefix in the input field above the browser. results are displayed with links in the repl. if a single file is found, it is opens in the editor.
grep in all loaded files with
g str in the input field.
matches are displayed in the repl.
restrict the search to files with a specific extension, e.g. all k files by
the string is matched directly, not as a regular expression.
definitions of a variable in all k files are searched with
all definitions show up in the repl as links.
find, grep and definitions can also be executed without argument, in which case the currently selected text from the editor is used.
"\n"/:(z.k /built-in k.wasm a.k;b.k /included files ed) /editor valueif the error is within the code shown in the editor, it is highlighted directly. otherwise a link is appended to the repl giving the user time to save the current file.
by default only the innermost error position is tracked by kvm.
that may may be in the built-in
z.k (e.g. the formatter), which may not be very informative.
for a complete stack trace, turn use the debugger by turning on the switch.
d.wasm instead of
it is a special build of k that traces each call in the virtual machine by calling js functions
js stores all functions and their arguments on a stack that is present in case of a trap.
simple plot.js plot F plot(1.0;x) plot(F;F) plot(x;y) plot(F;F;..) plot `x`y(!'x;x) multiple lines plot Z polar plot(Z;Z;..) polar multiple datasets single canvas, autoscale, grid, click-to-point, zoom rectangle, no decoration