User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:variables:repl-plus [2017/05/01 21:00] (current)
Line 1: Line 1:
 +====== Variable +, ++, +++ ======
 +
 +====Value Type====
 +an //​[[CL:​Glossary:​object]]//​.
 +
 +====Initial Value====
 +//​[[CL:​Glossary:​implementation-dependent]]//​.
 +
 +====Description====
 +
 +The //​[[CL:​Glossary:​variable|variables]]//​ **+**, **++**, and **+++** are maintained by the //​[[CL:​Glossary:​Lisp read-eval-print loop]]// to save //​[[CL:​Glossary:​forms]]//​ that were recently //​[[CL:​Glossary:​evaluated]]//​.
 +
 +The value of **+** is the last //​[[CL:​Glossary:​form]]//​ that was //​[[CL:​Glossary:​evaluated]]//,​ the value of **++** is the previous value of **+**, and **+++** is the previous value of **++**.
 +
 +====Examples====
 +<​blockquote>​
 +([[CL:​Functions:​math-add|+]] 0 1) <​r>​1</​r>​
 +([[CL:​Functions:​math-subtract|-]] 4 2) <​r>​2</​r>​
 +([[CL:​Functions:​math-divide|/​]] 9 3) <​r>​3</​r>​
 +([[CL:​Functions:​list]] + ++ +++) <​r>​((/​ 9 3) (- 4 2) (+ 0 1))</​r>​
 +([[CL:​Macros:​defparameter]] *a* 1) <​r>​*A*</​r>​
 +([[CL:​Macros:​defparameter]] *b* 2) <​r>​*B*</​r>​
 +([[CL:​Macros:​defparameter]] *c* 3) <​r>​*B*</​r>​
 +([[CL:​Macros:​defparameter]] *d* ([[CL:​Functions:​list]] *a* *b* *c*)) <​r>​*D*</​r>​
 +([[CL:​Macros:​setf]] *a* 4 *b* 5 *c* 6 *d* ([[CL:​Functions:​list]] a b c)) <r>(4 5 6)</​r>​
 +([[CL:​Functions:​list]] *a* *b* *c*) <r>(4 5 6)</​r>​
 +([[CL:​Functions:​eval]] +++) <r>(1 2 3)</​r>​
 +#.`(,@++ *d*) <r>(1 2 3 (1 2 3))</​r>​
 +</​blockquote>​
 +
 +====Affected By====
 +//​[[CL:​Glossary:​Lisp read-eval-print loop]]//.
 +
 +====See Also====
 +**[[CL:​Variables:​repl-minus|Variable -]]**, **[[CL:​Variables:​repl-star|Variable *]]**, **[[CL:​Variables:​repl-slash|Variable/​]]**,​ {\secref\TopLevelLoop}
 +
 +====Notes====
 +None.
 +