MacroPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Significant update since 9.0 release.
8.2 version

defvar-nonbindable

Arguments: symbol &optional initial-value-form documentation-string

This macro acts like a defvar, with the additional function of flagging symbol so that it cannot be lambda-bound. This means all references to symbol's value are to (sys:global-symbol-value 'symbol).

Here is an example showing the error signaled when there is an attempt to bind a non-bindable variable.


cl-user(1): (defvar-nonbindable *foo*)
*foo*
cl-user(2): (setq *foo* 10)
10
cl-user(3): (let ((*foo* 20)) *foo*)
Error: Cannot bind *foo* -- it is an unbindable symbol.
  [condition type: program-error]

Restart actions (select using :continue):
 0: Prompt for a new variable name.
 1: Return to Top Level (an "abort" restart).
 2: Abort entirely from this (lisp) process.
[1c] cl-user(4): 

In the initial SMP implementation, only symbols defined with defvar-nonbindable were suitable as places for atomic update operators like push-atomic. This is not longer true. Any symbol can be used as such a place. This macro is therefore no longer associated with atomic updates but is retained because it may be useful for other purposes.

See smp.htm and multiprocessing.htm for more information on this macro and on multiprocessing.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Significant update since 9.0 release.
8.2 version