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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>User Interface (GCL SI Manual)</title>
<meta name="description" content="User Interface (GCL SI Manual)">
<meta name="keywords" content="User Interface (GCL SI Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Function-and-Variable-Index.html" rel="index" title="Function and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
<link href="Doc.html" rel="next" title="Doc">
<link href="Iteration-and-Tests.html" rel="prev" title="Iteration and Tests">
<style type="text/css">
<!--
a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
span:hover a.copiable-anchor {visibility: visible}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<div class="chapter" id="User-Interface">
<div class="header">
<p>
Next: <a href="Doc.html" accesskey="n" rel="next">Doc</a>, Previous: <a href="Iteration-and-Tests.html" accesskey="p" rel="prev">Iteration and Tests</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="User-Interface-1"></span><h2 class="chapter">12 User Interface</h2>
<dl class="def">
<dt id="index-_002d-1"><span class="category">Special Variable: </span><span><strong>-</strong><a href='#index-_002d-1' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Holds the top-level form that GCL is currently evaluating.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002d"><span class="category">Function: </span><span><strong>-</strong> <em>(number &rest more-numbers)</em><a href='#index-_002d' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Subtracts the second and all subsequent NUMBERs from the first NUMBER.
With one arg, negates it.
</p>
</dd></dl>
<dl class="def">
<dt id="index-UNTRACE"><span class="category">Macro: </span><span><strong>UNTRACE</strong><a href='#index-UNTRACE' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Syntax:
</p><div class="example">
<pre class="example">(untrace {function-name}*)
</pre></div>
<p>Removes tracing from the specified functions. With no FUNCTION-NAMEs,
untraces all functions.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002a_002a_002a"><span class="category">Variable: </span><span><strong>***</strong><a href='#index-_002a_002a_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Gets the previous value of ** when GCL evaluates a top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-MAKE_002dSTRING_002dINPUT_002dSTREAM-1"><span class="category">Function: </span><span><strong>MAKE-STRING-INPUT-STREAM</strong> <em>(string &optional (start 0) (end (length string)))</em><a href='#index-MAKE_002dSTRING_002dINPUT_002dSTREAM-1' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Returns an input stream which will supply the characters of String between
Start and End in order.
</p>
</dd></dl>
<dl class="def">
<dt id="index-STEP"><span class="category">Macro: </span><span><strong>STEP</strong><a href='#index-STEP' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Syntax:
</p><div class="example">
<pre class="example">(step form)
</pre></div>
<p>Evaluates FORM in the single-step mode and returns the value.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002aBREAK_002dENABLE_002a"><span class="category">Variable: </span><span><strong>*BREAK-ENABLE*</strong><a href='#index-_002aBREAK_002dENABLE_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
GCL specific: When an error occurrs, control enters to the break loop only
if the value of this variable is non-NIL.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002f-1"><span class="category">Special Variable: </span><span><strong>/</strong><a href='#index-_002f-1' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Holds a list of the values of the last top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-DESCRIBE"><span class="category">Function: </span><span><strong>DESCRIBE</strong> <em>(x)</em><a href='#index-DESCRIBE' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Prints a description of the object X.
</p>
</dd></dl>
<dl class="def">
<dt id="index-ED"><span class="category">Function: </span><span><strong>ED</strong> <em>(&optional x)</em><a href='#index-ED' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Invokes the editor. The action depends on the version of GCL.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002aDEBUG_002dIO_002a"><span class="category">Variable: </span><span><strong>*DEBUG-IO*</strong><a href='#index-_002aDEBUG_002dIO_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Holds the I/O stream used by the GCL debugger.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002aBREAK_002dON_002dWARNINGS_002a"><span class="category">Variable: </span><span><strong>*BREAK-ON-WARNINGS*</strong><a href='#index-_002aBREAK_002dON_002dWARNINGS_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
When the function WARN is called, control enters to the break loop only
if the value of this varialbe is non-NIL.
</p>
</dd></dl>
<dl class="def">
<dt id="index-CERROR"><span class="category">Function: </span><span><strong>CERROR</strong> <em>(continue-format-string error-format-string &rest args)</em><a href='#index-CERROR' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Signals a correctable error.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002a_002a"><span class="category">Variable: </span><span><strong>**</strong><a href='#index-_002a_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Gets the previous value of * when GCL evaluates a top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002b_002b_002b"><span class="category">Special Variable: </span><span><strong>+++</strong><a href='#index-_002b_002b_002b' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Gets the previous value of ++ when GCL evaluates a top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-INSPECT"><span class="category">Function: </span><span><strong>INSPECT</strong> <em>(x)</em><a href='#index-INSPECT' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Shows the information about the object X in an interactive manner
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002f_002f"><span class="category">Special Variable: </span><span><strong>//</strong><a href='#index-_002f_002f' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Gets the previous value of / when GCL evaluates a top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002aTRACE_002dOUTPUT_002a"><span class="category">Variable: </span><span><strong>*TRACE-OUTPUT*</strong><a href='#index-_002aTRACE_002dOUTPUT_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
The trace output stream.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002b_002b"><span class="category">Special Variable: </span><span><strong>++</strong><a href='#index-_002b_002b' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Gets the previous value of + when GCL evaluates a top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002aERROR_002dOUTPUT_002a"><span class="category">Variable: </span><span><strong>*ERROR-OUTPUT*</strong><a href='#index-_002aERROR_002dOUTPUT_002a' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Holds the output stream for error messages.
</p>
</dd></dl>
<dl class="def">
<dt id="index-DRIBBLE"><span class="category">Function: </span><span><strong>DRIBBLE</strong> <em>(&optional pathname)</em><a href='#index-DRIBBLE' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>If PATHNAME is given, begins to record the interaction to the specified file.
If PATHNAME is not given, ends the recording.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002a-1"><span class="category">Variable: </span><span><strong>*</strong><a href='#index-_002a-1' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Holds the value of the last top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002f_002f_002f"><span class="category">Special Variable: </span><span><strong>///</strong><a href='#index-_002f_002f_002f' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Gets the previous value of // when GCL evaluates a top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-WARN"><span class="category">Function: </span><span><strong>WARN</strong> <em>(format-string &rest args)</em><a href='#index-WARN' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Formats FORMAT-STRING and ARGs to *ERROR-OUTPUT* as a warning message.
</p>
</dd></dl>
<dl class="def">
<dt id="index-BREAK"><span class="category">Function: </span><span><strong>BREAK</strong> <em>(&optional (format-string nil) &rest args)</em><a href='#index-BREAK' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Enters a break loop. If FORMAT-STRING is non-NIL, formats FORMAT-STRING
and ARGS to *ERROR-OUTPUT* before entering a break loop.
Typing :HELP at the break loop will list the break-loop commands.
</p>
</dd></dl>
<dl class="def">
<dt id="index-_002b-1"><span class="category">Special Variable: </span><span><strong>+</strong><a href='#index-_002b-1' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
Holds the last top-level form.
</p>
</dd></dl>
<dl class="def">
<dt id="index-TRACE"><span class="category">Macro: </span><span><strong>TRACE</strong><a href='#index-TRACE' class='copiable-anchor'> ¶</a></span></dt>
<dd><p>Package:LISP
</p>
<p>Syntax:
</p><div class="example">
<pre class="example">(trace {function-name}*)
</pre></div>
<p>Traces the specified functions. With no FUNCTION-NAMEs, returns a list of
functions currently being traced.
</p>
<p>Additional Keywords are allowed in GCL with the
syntax (trace {fn | (fn {:kw form}*)}*)
</p>
<p>For each FN naming a function, traces that function. Each :KW should
be one of the ones listed below, and FORM should have the
corresponding form. No :KW may be given more than once for the same
FN. Returns a list of all FNs now traced which weren’t already
traced.
</p>
<p>EXAMPLE (Try this with your favorite factorial function FACT):
</p>
<div class="example">
<pre class="example">;; print entry args and exit values
(trace FACT)
;; Break coming out of FACT if the value is bigger than 1000.
(trace (fact :exit
(progn
(if (> (car values) 1000)(break "big result"))
(car values))))
;; Hairy example:
;;make arglist available without the si:: prefix
(import 'si::arglist)
(trace (fact
:DECLARATIONS
((in-string "Here comes input: ")
(out-string "Here comes output: ")
all-values
(silly (+ 3 4)))
:COND
(equal (rem (car arglist) 2) 0)
:ENTRY
(progn
(cond
((equal (car arglist) 8)
(princ "Entering FACT on input 8!! ")
(setq out-string "Here comes output from inside (FACT 8): "))
(t
(princ in-string)))
(car arglist))
:EXIT
(progn
(setq all-values (cons (car values) all-values))
(princ out-string)
(when (equal (car arglist) 8)
;; reset out-string
(setq out-string "Here comes output: "))
(cons 'fact values))
:ENTRYCOND
(not (= (car arglist) 6))
:EXITCOND
(not (= (car values) (* 6 (car arglist))))
:DEPTH
5))
</pre></div>
<p>Syntax is <code>:keyword</code> <i>form1</i> <code>:keyword</code> <i>form2</i> ...
</p>
<dl compact="compact">
<dt><span><code>:declarations</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: NIL
</pre></div>
<p>FORM is ((var1 form1 )(var2 form2 )...), where
the var_i are symbols distinct from each other and from
all symbols which are similarly declared for currently
traced functions. Each form is evaluated immediately.
Upon any invocation of a traced function when not already
inside a traced function call, each var is bound to
that value of form .
</p>
</dd>
<dt><span><code>:COND</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: T
</pre></div>
<p>Here, FORM is any Lisp form to be evaluated (by EVAL)
upon entering a call of FN, in the environment where si::ARGLIST
is bound to the current list of arguments of FN. Note that
even if the evaluation of FORM changes the value of SI::ARGLIST
(e.g. by evaluation of (SETQ si::ARGLIST ...)), the list of
arguments passed to FN is unchanged. Users may alter args passed
by destructively modifying the list structure of SI::ARGLIST
however. The call is traced
(thus invoking the :ENTRYCOND and :EXITCOND forms, at least)
if and only if FORM does not evaluate to NIL.
</p>
</dd>
<dt><span><code>:ENTRYCOND</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: T
</pre></div>
<p>This is evaluated (by EVAL) if the :COND form evaluates to
non-NIL, both in an environment where SI::ARGLIST is bound to the
current list of arguments of FN. If non-NIL, the :ENTRY form
is then evaluated and printed with the trace "prompt".
</p>
</dd>
<dt><span><code>:ENTRY</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: (CONS (QUOTE x) SI::ARGLIST),
</pre></div>
<p>where x is the symbol we call FN
If the :COND and :ENTRYCOND forms evaluate to non-NIL,
then the trace "prompt" is printed and then this FORM is
evaluated (by EVAL) in an environment where SI::ARGLIST is bound
to the current list of arguments of FN. The result is then
printed.
</p>
</dd>
<dt><span><code>:EXITCOND</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: T
</pre></div>
<p>This is evaluated (by EVAL) in the environment described
below for the :EXIT form. The :EXIT form is then evaluated
and printed with the "prompt" if and only if the result here
is non-NIL.
</p>
</dd>
<dt><span><code>:EXIT</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: (CONS (QUOTE x) VALUES),
</pre></div>
<p>where x is the symbol we call FN
Upon exit from tracing a given call, this FORM is
evaluated (after the appropriate trace "prompt" is printed),
using EVAL in an environment where SI::ARGLIST is bound to the
current list of arguments of FN and VALUES is bound to the
list of values returned by FN (recalling that Common Lisp
functions may return multiple values).
</p>
</dd>
<dt><span><code>:DEPTH</code></span></dt>
<dd><div class="example">
<pre class="example">DEFAULT: No depth limit
</pre></div>
<p>FORM is simply a positive integer specifying the maximum
nesting of traced calls of FN, i.e. of calls of FN in which
the :COND form evaluated to non-NIL. For calls of FN in
which this limit is exceeded, even the :COND form is not
evaluated, and the call is not traced.
</p>
</dd>
</dl>
</dd></dl>
</div>
<hr>
<div class="header">
<p>
Next: <a href="Doc.html">Doc</a>, Previous: <a href="Iteration-and-Tests.html">Iteration and Tests</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|