@node Variable Aliases
@section Variable Aliases
- When maintaining Lisp programs, it is sometimes useful to make two
-variables synonyms for each other, so that both variables invariably
-refer to the same value. When a program variable slightly changes
-meaning, or when a variable name was chosen badly to begin with, it is
-desirable to rename that variable. For compatibility with older
-versions of the program it is also desirable to not break code that
-uses the original variable name. This can be done with
+ During the maintenance of Lisp programs, it is sometimes useful to
+make two variables synonyms for each other, so that both variables
+invariably refer to the same value. When a program variable slightly
+changes meaning, or when a variable name is chosen badly to begin
+with, it is desirable to rename that variable. For compatibility with
+older versions of the program it is also desirable to not break code
+using the original variable name. This can be done with
@code{defvaralias}.
@defun defvaralias old-name new-name
@defun indirect-variable name
This function returns the variable at the end of the variable chain
of @var{name}. If @var{name} is not a symbol or if @var{name}
-is not a variable alias, @var{name} is returned unchanged.
+is not a variable alias, this function returns @var{name} unchanged.
@end defun
@example
(defvaralias 'foo 'bar)
+(indirect-variable 'foo)
+ @result{} bar
(setq bar 2)
bar
@result{} 2