kde includes:
/comments
and "strings"
are detectedsemicolons
are printed lighter$[cond;a;cond;b;else]
marks conditions differently$[cond;a;cond;b]
indicates an error for missing else1+ \x
highlights debug backslash(}
are marked as errorsclicking run
restarts k and evaluates the program in the editor.
the same can be done with shift-enter
or 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 a.k
then 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 x
.
text that is written by k with `<"text"
or 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 dir
.
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 bold
and underlines
modified files that have not been written.
it does not track changes happening on disk.
`file<"bytes"
writes to disk and
x:<`file
reads.`$<`"."
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 g.k str
.
the string is matched directly, not as a regular expression.
definitions of a variable in all k files are searched with :varname
.
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.
run
uses d.wasm
instead of k.wasm
.
it is a special build of k that traces each call in the virtual machine by calling js functions fpush
and fpop
.
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