Luc Teirlinck writes: > Nick Roberts wrote: > > > (defvar var1 "DOC1") > > (defvar var2 "DOC2") > > (defvaralias 'var1 'var2) > > I think if an alias is made only then only one of the variables needs to > be > declared. > > So the idea of the present behavior would be to do a > (defvaralias 'var1 'var2) with a defvar for var1 instead of for var2? > I do not believe that would be appropriate.
I mean: (defvar var2 "DOC2") (defvaralias 'var1 'var2) is doesn't give compiler warnings. Presumably defvaralias is a declaration for var1. > As Stefan has pointed out defvaralias has a symmetry in its > arguments (unlike define-obsolete-variable-alias neither) > > I do not understand. The variable alias structure is a directed > graph, not an undirected graph. The arguments to defvaralias are > asymmetric in their meaning. The first argument is the alias, the > second the base variable. > > (defvaralias 'var1 'var2) > > is different (in non-trivial ways) from > > (defvaralias 'var2 'var1) > Yes, you're right and I'm misquoting Stefan. There must be some symmetry, however as: (defvar var2 "DOC2") (defvaralias 'var1 'var2) (defvar var1a "DOC1") (defvaralias 'var1a 'var2a) doesn't give compiler warnings either. Nick > in as far as `indirect-variable', cyclic variable indirection errors > and such are concerned. > > Sincerely, > > Luc. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel