6.2 Variable Functions

In the following descriptions name is the symbol name of the variable. [annotate]

defhvar  string-name documentation [Function]
          

This function defines a Hemlock variable. Functions that take a variable name signal an error when the variable is undefined. [annotate]

string-name
The string name of the variable to define. [annotate]
documentation
The documentation string for the variable. [annotate]
:mode, :buffer
If buffer is supplied, the variable is local to that buffer. If mode is supplied, it is local to that mode. If neither is supplied, it is global. [annotate]
:value
This is the initial value for the variable, which defaults to nil. [annotate]
:hooks
This is the initial list of functions to call when someone sets the variable's value. These functions execute before Hemlock establishes the new value. See variable-value for the arguments passed to the hook functions. [annotate]

If a variable with the same name already exists in the same place, then defhvar sets its hooks and value from hooks and value if the user supplies these keywords. [annotate]

[annotate]

variable-value  name &optional kind where [Function]
          

This function returns the value of a Hemlock variable in some place. The following values for kind are defined: [annotate]

:current
Return the value present in the current environment, taking into consideration any mode or buffer local variables. This is the default. [annotate]
:global
Return the global value. [annotate]
:mode
Return the value in the mode named where. [annotate]
:buffer
Return the value in the buffer where. [annotate]

When set with setf, Hemlock sets the value of the specified variable and invokes the functions in its hook list with name, kind, where, and the new value. [annotate]

[annotate]

variable-documentation  name &optional kind where [Function]
variable-hooks  name &optional kind where [Function]
variable-name  name &optional kind where [Function]
          

These function return the documentation, hooks and string name of a Hemlock variable. The kind and where arguments are the same as for variable-value. The documentation and hook list may be set using setf. [annotate]

[annotate]

string-to-variable  string [Function]
          

This function converts a string into the corresponding variable symbol name. String need not be the name of an actual Hemlock variable. [annotate]

[annotate]

value  name [Macro]
setv  name new-value [Macro]
          

These macros get and set the current value of the Hemlock variable name. Name is not evaluated. There is a setf form for value. [annotate]

[annotate]

hlet  ((var value)) form [Macro]
          

This macro is very similar to let in effect; within its scope each of the Hemlock variables var have the respective values, but after the scope is exited by any means the binding is removed. This does not cause any hooks to be invoked. The value of the last form is returned. [annotate]

[annotate]

hemlock-bound-p  name &optional kind where [Function]
          

Returns t if name is defined as a Hemlock variable in the place specified by kind and where, or nil otherwise. [annotate]

[annotate]

delete-variable  name &optional kind where [Function]
Delete Variable Hook  (initial value ) [Variable]
          

delete-variable makes the Hemlock variable name no longer defined in the specified place. Kind and where have the same meanings as they do for variable-value, except that :current is not available, and the default for kind is :global [annotate]

An error will be signaled if no such variable exists. The hook, Delete Variable Hook is invoked with the same arguments before the variable is deleted. [annotate]

[annotate]