In computing, direct or immediate mode
in an interactive programming system is the immediate execution of
commands,
statements, or
expressions. In many interactive systems, most of these can both be included in programs or executed directly in a
read–eval–print loop
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written ...
(REPL).
Most interactive systems also offer the possibility of defining programs in the REPL, either with explicit declarations, such as
Python's
def
, or by labelling them with
line number
In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increm ...
s. Programs can then be run by calling a named or numbered procedure or by running a main program.
Many programming systems, from
Lisp
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation.
Originally specified in the late 1950s, ...
and
JOSS
JOSS (acronym for JOHNNIAC Open Shop System) was one of the first interactive, time-sharing programming languages. It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as bo ...
to
Python and
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".
Perl was developed ...
have interactive
REPLs which also allow defining programs. Most
integrated development environment
An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
s offer a direct mode where, during
debugging
In engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs.
For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
and while the program execution is suspended, commands can be executed directly in the current scope and the result is displayed.
Example
;Non-direct mode in Basic
;Direct mode in Basic
References
{{reflist
User interfaces
Computing terminology