DISASSEMBLE
EXT:UNCOMPILE
DOCUMENTATION
DESCRIBE
TRACE
INSPECT
ROOM
TIME
ED
APROPOS
& APROPOS-LIST
DRIBBLE
LISP-IMPLEMENTATION-VERSION
EXT:ARGV
DISASSEMBLE
DISASSEMBLE
can disassemble to machine code,
provided that GNU gdb is present.
In that case the argument may be a
EXT:SYSTEM-FUNCTION
, a FFI:FOREIGN-FUNCTION
, a
special operator handler, a SYMBOL
denoting one of these, an
INTEGER
(address), or a STRING
.
EXT:UNCOMPILE
The function EXT:UNCOMPILE
does the converse of
COMPILE
: (
reverts a compiled
EXT:UNCOMPILE
function
)function
(name), that has been entered or loaded in the same session
and then compiled, back to its interpreted form.
DOCUMENTATION
No on-line documentation is available for the system functions
(yet), but see Section 25.2.4, “Function DESCRIBE
”.
DESCRIBE
When CUSTOM:*BROWSER*
is non-NIL
, and CUSTOM:CLHS-ROOT
returns a valid URL,
DESCRIBE
on a standard Common Lisp symbol will point your web browser to the
appropriate [CLHS] page.
Also, when CUSTOM:*BROWSER*
is non-NIL
, and CUSTOM:IMPNOTES-ROOT
returns a
valid URL, DESCRIBE
on symbols and packages documented in these
implementation notes will point your web browser to the appropriate
page.
Function CUSTOM:CLHS-ROOT
. Function CUSTOM:CLHS-ROOT
is defined in config.lisp
. By default it
looks at (
and EXT:GETENV
"CLHSROOT")CUSTOM:*CLHS-ROOT-DEFAULT*
,
but you may redefine it in config.lisp
or RC file.
The return value should be a STRING
terminated with a "/"
,
e.g., http://www.lisp.org/HyperSpec/ or /usr/doc/HyperSpec/
.
If the return value is NIL
, the feature is completely disabled.
Function CUSTOM:IMPNOTES-ROOT
. Function CUSTOM:IMPNOTES-ROOT
is defined in config.lisp
. By default it
looks at (
and EXT:GETENV
"IMPNOTES")CUSTOM:*IMPNOTES-ROOT-DEFAULT*
,
but you may redefine it in config.lisp
or RC file.
The return value should be a STRING
terminated with a "/"
,
e.g., http://clisp.cons.org/impnotes/, or the path to
the monolithic page, e.g., http://clisp.cons.org/impnotes.html
or /usr/doc/clisp/impnotes.html
.
If the return value is NIL
, the feature is completely disabled.
TRACE
(
makes the
functions TRACE
function
...)function
, ... traced. function
should be either a symbol or
a list (
, wheresymbol
&KEY
:SUPPRESS-IF
:MAX-DEPTH
:STEP-IF
:PRE
:POST
:PRE-BREAK-IF
:POST-BREAK-IF
:PRE-PRINT
:POST-PRINT
:PRINT
)
:SUPPRESS-IF
form
form
is true
:MAX-DEPTH
form
(>
*trace-level* form
)
. This is useful for tracing functions that
are use by the tracer itself, such as PRINT-OBJECT
, or otherwise when
tracing would lead to an infinite recursion.
:STEP-IF
form
form
is true
:PRE
form
form
before calling the function
:POST
form
form
after return from the function
:PRE-BREAK-IF
form
form
is true:POST-BREAK-IF
form
form
is true:PRE-PRINT
form
form
before calling the
function:POST-PRINT
form
form
after return from the
function:PRINT
form
form
both before calling
and after return from the functionIn all these forms you can access the following variables:
EXT:*TRACE-FUNCTION*
EXT:*TRACE-ARGS*
EXT:*TRACE-FORM*
EXT:*TRACE-VALUES*
and you can leave the function call with specified values by using
RETURN
.
TRACE
and UNTRACE
are also applicable to functions
(
and to macros, but not to
locally defined functions and macros.SETF
symbol
)
Variable CUSTOM:*TRACE-INDENT*
. If you want the TRACE
level to be indicated by the indentation
in addition to the printed numbers, set CUSTOM:*TRACE-INDENT*
to non-NIL
.
Initially it is NIL
since many nested traced calls will easily
exhaust the available line length.
INSPECT
The function INSPECT
takes a keyword argument
:FRONTEND
, which specifies the way CLISP will
interact with the user, and defaults
to CUSTOM:*INSPECT-FRONTEND*
.
Available :FRONTEND
s for
INSPECT
in CLISP
:TTY
*TERMINAL-IO*
stream. Please use the :h
command to get the
list of all available commands.:HTTP
A window in your Web browser (specified by the
:BROWSER
keyword argument) is opened and it is controlled by
CLISP via a SOCKET:SOCKET-STREAM
, using the HTTP protocol.
You should be able to use all the standard browser features.
Since CLISP is not multitasking at this time, you will not
be able to do anything else during an INSPECT
session. Please click on
the quit
link to terminate the session.
Please be aware though, that once you terminate an INSPECT
session, all links in all INSPECT
windows in your browser will become
obsolete and using them in a new INSPECT
session will result in
unpredictable behavior.
The function INSPECT
also takes a keyword argument :BROWSER
,
which specifies the browser used by the :HTTP
front-end and defaults to CUSTOM:*INSPECT-BROWSER*
.
The function INSPECT
binds some
pretty-printer variables:
Variable | Bound to |
---|---|
*PRINT-LENGTH* | CUSTOM:*INSPECT-PRINT-LENGTH* |
*PRINT-LEVEL* | CUSTOM:*INSPECT-PRINT-LEVEL* |
*PRINT-LINES* | CUSTOM:*INSPECT-PRINT-LINES* |
User variable
CUSTOM:*INSPECT-LENGTH*
specifies the number of sequence elements printed in detail when a
sequence is inspected.
ROOM
The function ROOM
returns two values: the number of bytes
currently occupied by Lisp objects, and the number of bytes that can be
allocated before the next regular garbage-collection occurs.
The function
EXT:GC
starts a global garbage-collection and its return value has the same meaning as
the second value of ROOM
.
TIME
The timing data printed by the macro TIME
includes:
the real time (“wall” time), |
the run time (processor time for this process), |
the number of bytes allocated, and |
the number of garbage-collections performed, if any. |
The macro EXT:TIMES
(mnemonic:
“TIME and Space”)
is like the macro TIME
: (
evaluates the
EXT:TIMES
form
)form
, and, as a side effect, outputs detailed information about the
memory allocations caused by this evaluation. It also prints
everything printed by TIME
.
ED
The function ED
calls the external editor specified by the value
of (
or, failing that, the value of the variable
EXT:GETENV
"EDITOR")CUSTOM:*EDITOR*
(set in config.lisp
).
If the argument is a function name which was defined in the current
session (not loaded from a file), the program text to be edited is a
pretty-printed version (without comments) of the text which was used to
define the function.
Default Time Zone
CUSTOM:*DEFAULT-TIME-ZONE*
contains the default time zone used by ENCODE-UNIVERSAL-TIME
and
DECODE-UNIVERSAL-TIME
. It is initially set to -1
(which means 1 hour east of Greenwich, i.e., Mid European Time).
The time zone in a decoded time does not necessarily have be an
INTEGER
, but (as FLOAT
or RATIONAL
number)
it should be a multiple of 1/3600
.
GET-INTERNAL-RUN-TIME
returns the amount of run time
consumed by the current CLISP process since its startup.
SHORT-SITE-NAME
, LONG-SITE-NAME
should be defined in a site-specific config.lisp
file.
The default implementations try to read the value of the environment variable
ORGANIZATION
, and, failing that,
call uname
.
SHORT-SITE-NAME
, LONG-SITE-NAME
should be defined in a site-specific config.lisp
file.
The default implementations try to read the registry.
MACHINE-TYPE
, MACHINE-VERSION
,
MACHINE-INSTANCE
and SHORT-SITE-NAME
, LONG-SITE-NAME
should be
defined by every user in his user-specific config.lisp
file.
APROPOS
& APROPOS-LIST
The search performed by APROPOS
and APROPOS-LIST
is
case-insensitive.
Variable CUSTOM:*APROPOS-DO-MORE*
. You can make APROPOS
print more information about the symbols it
found by setting CUSTOM:*APROPOS-DO-MORE*
to a list containing some of
:FUNCTION
, :VARIABLE
, :TYPE
, and :CLASS
or just set it to T
to get all of the values.
Variable CUSTOM:*APROPOS-MATCHER*
. You can make APROPOS
and APROPOS-LIST
be more flexible in
their search by setting CUSTOM:*APROPOS-MATCHER*
to a FUNCTION
of one
argument, a pattern (a STRING
), returning a new FUNCTION
of one
argument, a SYMBOL
name (also a STRING
),
which returns non-NIL
when the symbol name matches the pattern
for the purposes of APROPOS
.
When CUSTOM:*APROPOS-MATCHER*
is NIL
, SEARCH
is used.
Some modules come with functions which can be used for
CUSTOM:*APROPOS-MATCHER*
, e.g., REGEXP:REGEXP-MATCHER
,
WILDCARD:WILDCARD-MATCHER
,
PCRE:PCRE-MATCHER
.
DRIBBLE
If DRIBBLE
is called with an argument, and dribbling is already
enabled, a warning is printed, and the new dribbling request is
ignored.
Dribbling is implemented via a kind (but not a recognizable subtype)
of TWO-WAY-STREAM
, named EXT:DRIBBLE-STREAM
.
If you have a source
bidirectional STREAM
x
and you want all transactions
(input and output) on x
to be copied to the target
output STREAM
y
,
you can do
(DEFVAR
*loggable*x
) (SETQ
x
(MAKE-SYNONYM-STREAM
'*loggable*)) (DEFUN
toggle-logging (&OPTIONAL
s) (MULTIPLE-VALUE-BIND
(so ta) (dribble-toggle *loggable* s) (WHEN
(STREAMP
so) (SETQ
*loggable* so)) ta)) (toggle-loggingy
) ; start logging ... (toggle-logging) ; finish logging ... (toggle-loggingy
) ; restart logging ... (toggle-logging) ; finish logging (CLOSE
y
)
(EXT:DRIBBLE-STREAM
stream
)
stream
is a EXT:DRIBBLE-STREAM
, returns two values:
the source
and the target
streams. Otherwise returns NIL
.
(EXT:DRIBBLE-STREAM-P
stream
)
stream
is a EXT:DRIBBLE-STREAM
, returns T
, otherwise
returns NIL
.
(EXT:DRIBBLE-STREAM-SOURCE
stream
)
stream
is a EXT:DRIBBLE-STREAM
, returns its
source
stream, otherwise signals a TYPE-ERROR
.
(EXT:DRIBBLE-STREAM-TARGET
stream
)
stream
is a EXT:DRIBBLE-STREAM
, returns its
target
stream, otherwise signals a TYPE-ERROR
.
(EXT:MAKE-DRIBBLE-STREAM
source
target
)
EXT:DRIBBLE-STREAM
.
(EXT:DRIBBLE-TOGGLE
stream
&OPTIONAL
pathname
)
stream
is a EXT:DRIBBLE-STREAM
and pathname
is NIL
,
writes a dribble termination note to the stream
's target
STREAM
and returns stream
's source
and target
STREAM
s;
when stream
is not a EXT:DRIBBLE-STREAM
and pathname
is non-NIL
,
creates a new EXT:DRIBBLE-STREAM
, dribbling from stream
to pathname
,
writes a dribble initialization note to pathname
,
and return the EXT:DRIBBLE-STREAM
(the second value is the target
STREAM
);
otherwise WARN
that no appropriate action may be taken.
pathname
may be an open output STREAM
or a pathname designator.
See above for the sample usage.
See also src/dribble.lisp
in
the CLISP source tree.
DRIBBLE
DRIBBLE
works by operating on *TERMINAL-IO*
,
thus is does not work when CLISP acts as a script interpreter
(see Section 31.6.2, “Scripting with CLISP”).
Traditionally, Common Lisp implementations set *STANDARD-INPUT*
,
*STANDARD-OUTPUT*
, and *ERROR-OUTPUT*
to a SYNONYM-STREAM
pointing to *TERMINAL-IO*
, and CLISP is no exception.
Thus changing *TERMINAL-IO*
to a dribble stream affects all
standard i/o.
On the other hand, when CLISP acts as a script interpreter,
it adheres to the UNIX <stdio.h
>
conventions, thus *STANDARD-INPUT*
,
*STANDARD-OUTPUT*
, and *ERROR-OUTPUT*
are normal FILE-STREAM
s,
and thus are not affected by DRIBBLE
(*TERMINAL-IO*
- and
thus (
- is still affected).
The [ANSI CL] explicitly permits this behavior by stating
PRINT
... T
)
DRIBBLE
is intended primarily for interactive debugging; its effect cannot be relied upon when used in a program.
LISP-IMPLEMENTATION-VERSION
LISP-IMPLEMENTATION-VERSION
returns
the numeric version (like 3.14
), and
the release date (like "1999-07-21"
).
When running on the same machine on which CLISP was built, it appends
the binary build and memory image dump date in universal time
(like 3141592654
).
When running on a different machine, it appends the MACHINE-INSTANCE
of the machine on which it was built.
This function will return a fresh SIMPLE-VECTOR
of
STRING
command line arguments passed to the runtime, including
those already processed by CLISP.
Use EXT:*ARGS*
instead of this function to get the arguments for your program.
These notes document CLISP version 2.41 | Last modified: 2006-10-13 |