![[LISPWORKS]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fLWSmall.gif&f=jpg&w=240)
![[Common Lisp HyperSpec (TM)]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fCLHS_Sm.gif&f=jpg&w=240)
Syntax:
progvsymbolsvaluesform* =>result*
Arguments and Values:
symbols---alist ofsymbols; evaluated.
values---alist ofobjects; evaluated.
forms---animplicit progn.
results---thevalues returned by theforms.
Description:
progv creates new dynamic variablebindings and executes eachform using thosebindings. Eachform is evaluated in order.
progv allowsbinding one or more dynamic variables whose names may be determined at run time. Eachform is evaluated in order with the dynamic variables whose names are insymbols bound to correspondingvalues. If too fewvalues are supplied, the remainingsymbols are bound and then made to have no value. If too manyvalues are supplied, the excess values are ignored. Thebindings of the dynamic variables are undone on exit fromprogv.
Examples:
(setq *x* 1) => 1 (progv '(*x*) '(2) *x*) => 2 *x* => 1Assuming *x* is not globally special, (let ((*x* 3)) (progv '(*x*) '(4) (list *x* (symbol-value '*x*)))) => (3 4)
Affected By: None.
Exceptional Situations: None.
See Also:
Notes:
Among other things,progv is useful when writing interpreters for languages embedded in Lisp; it provides a handle on the mechanism forbindingdynamic variables.