Книга: Practical Common Lisp
Local Variables
Local Variables
While the main variables needed within a loop are usually declared implicitly in for
clauses, sometimes you'll need auxiliary variables, which you can declare with with
clauses.
with var [ = value-form ]
The name var becomes the name of a local variable that will cease to exist when the loop finishes. If the with
clause contains an = value-form
part, the variable will be initialized, before the first iteration of the loop, to the value of value-form.
Multiple with
clauses can appear in a loop; each clause is evaluated independently in the order it appears and the value is assigned before proceeding to the next clause, allowing later variables to depend on the value of already declared variables. Mutually independent variables can be declared in one with
clause with an and
between each declaration.
- Scope of Variables
- Destructuring Variables
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- Using Environment Variables
- Creating and Configuring Local Printers
- Laying the Foundation: The localhost Interface
- Local GUI Client Access to a Database
- Configuring a Local Caching Nameserver
- Perl Variables and Data Structures
- Special Variables
- Class and Object Variables
- Variables