/usr/share/freemat/help/text/keyboard.mdc is in freemat-help 4.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | KEYBOARD KEYBOARD Initiate Interactive Debug Session
Usage
The keyboard statement is used to initiate an
interactive session at a specific point in a function.
The general syntax for the keyboard statement is
keyboard
A keyboard statement can be issued in a script,
in a function, or from within another keyboard session.
The result of a keyboard statement is that execution
of the program is halted, and you are given a prompt
of the form:
[scope,n] -->
where scope is the current scope of execution (either
the name of the function we are executing, or base otherwise).
And n is the depth of the keyboard session. If, for example,
we are in a keyboard session, and we call a function that issues
another keyboard session, the depth of that second session
will be one higher. Put another way, n is the number of return
statements you have to issue to get back to the base workspace.
Incidentally, a return is how you exit the keyboard session
and resume execution of the program from where it left off. A
retall can be used to shortcut execution and return to the base
workspace.
The keyboard statement is an excellent tool for debugging
FreeMat code, and along with eval provide a unique set of
capabilities not usually found in compiled environments. Indeed,
the keyboard statement is equivalent to a debugger breakpoint in
more traditional environments, but with significantly more inspection
power.
|