Re: My sawfishrc

On Sunday 04 October 2009 14:31:59 Allan Duncan wrote:
> Would the equivalent of (defvar viewport-dimensions nil) therefore
>  occur in sawfish.wm.gnome.integration or customize-command-classes
>  then?

viewport-dimensions is defined in sawfish.wm.viewport with defcustom, 
which also creates dynamically scoped variables.

>  That however implies that (define-special-variable
>  viewport-dimensions.. would create a new local scope

Local scopes are always limited by parentheses.  E.g., (let ((foo bar)) 
body...) creates a local scope for body.  So define-special-variable 
does not create any scope.

> am I misinterpreting defvar as a variable definition and
> storage allocation?

defvar declares the variable to be dynamically scoped.

> And could you combine (defvar foo nil) (setq foo bar) as (defvar foo
>  bar)?

Only if foo is not previously defined.  If it is, defvar keeps the 
previous value.

	Timo Korvola		<URL:>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]