In Interlisp, SETQ creates a persistent or global binding that keeps its value across computations. In contrast, LET and LET* create temporary, local variables that exist only within the current expression or function. LET evaluates and binds all variables in parallel, so none of them can refer to another defined in the same form. LET*, however, binds variables one at a time in sequence, allowing each new variable to use the values of those bound earlier, making it useful for stepwise calculations or dependent local values.
| Form | Scope | Example | Comments by Line Number |
|---|---|---|---|
| SETQ | Global Binding |
| 1. Global assignment: TEMP1 is now 10.2. Global assignment: RESULT is now 20.3. Global assignment: GLOBAL.VALUE is now 10.4. Returns the current value of RESULT (20). |
| LET | Local, Parallel Binding |
|
|
| LET* | Local, Sequential Binding |
|
|