Special variables: Difference between revisions
Content deleted Content added
→{{header|C}}: Added Common Lisp |
→{{header|Common Lisp}}: Added REPL-only special variables |
||
Line 426:
lst)))
(format t "
{{Out}}
<pre>(*BREAK-ON-SIGNALS* *COMPILE-FILE-PATHNAME* *COMPILE-FILE-TRUENAME* *COMPILE-PRINT* *COMPILE-VERBOSE* *DEBUG-IO*
*DEBUGGER-HOOK* *DEFAULT-PATHNAME-DEFAULTS* *ERROR-OUTPUT* *FEATURES* *GENSYM-COUNTER* *LOAD-PATHNAME*
*LOAD-PRINT* *LOAD-TRUENAME* *LOAD-VERBOSE* *MACROEXPAND-HOOK* *MODULES* *PACKAGE* *PRINT-ARRAY* *PRINT-BASE*
*PRINT-CASE* *PRINT-CIRCLE* *PRINT-ESCAPE* *PRINT-GENSYM* *PRINT-LENGTH* *PRINT-LEVEL* *PRINT-LINES*
*PRINT-MISER-WIDTH* *PRINT-PPRINT-DISPATCH* *PRINT-PRETTY* *PRINT-RADIX* *PRINT-READABLY* *PRINT-RIGHT-MARGIN*
*QUERY-IO* *RANDOM-STATE* *READ-BASE* *READ-DEFAULT-FLOAT-FORMAT* *READ-EVAL* *READ-SUPPRESS* *READTABLE*
*STANDARD-INPUT* *STANDARD-OUTPUT* *TERMINAL-IO* *TRACE-OUTPUT*)</pre>
Inside the REPL, there are more special variables available:
* -: Contains the form that is currently evaluated.
<pre>> (format t "~a" -)
(FORMAT T ~a -)
NIL</pre>
* *, **, ***: Contain the last, penultimate, antepenultimate primary values that were printed.
<pre>> (+ 1 2)
3
> (values 1 2)
1 ;
2
> (* 4 5)
20
> (list * ** ***)
(20 1 3)</pre>
* +, ++, +++: Contain the last, penultimate, antepenultimate forms that were evaluated.
<pre>> (+ 1 2)
3
> (values 1 2)
1 ;
2
> (* 4 5)
20
> (list + ++ +++)
((* 4 5) (VALUES 1 2) (+ 1 2))</pre>
* /, //, ///: Contain a list of the last, penultimate, antepenultimate values that were printed.
<pre>> (floor 10 2)
5 ;
0
> (values 1 'a "foo")
1 ;
A ;
"foo"
> (+ 1 2)
3
> (list / // ///)
((3) (1 A "foo") (5 0))</pre>
=={{header|D}}==
|