From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: defvaralias Date: Sat, 7 May 2005 13:19:58 +1200 Message-ID: <17020.6078.335703.434592@farnswood.snap.net.nz> References: <200505060142.j461gYF08458@raven.dms.auburn.edu> <17018.62209.92386.375984@farnswood.snap.net.nz> <200505061456.j46EuMh11458@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1115428817 24069 80.91.229.2 (7 May 2005 01:20:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 7 May 2005 01:20:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 07 03:20:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DUDz1-0000d4-6Q for ged-emacs-devel@m.gmane.org; Sat, 07 May 2005 03:19:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DUE6q-0005eI-1b for ged-emacs-devel@m.gmane.org; Fri, 06 May 2005 21:28:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DUE0g-0007g9-1t for emacs-devel@gnu.org; Fri, 06 May 2005 21:21:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DUE0c-0007ej-TC for emacs-devel@gnu.org; Fri, 06 May 2005 21:21:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DUE0c-0007eA-N4 for emacs-devel@gnu.org; Fri, 06 May 2005 21:21:34 -0400 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DUE4E-0007f6-Sz for emacs-devel@gnu.org; Fri, 06 May 2005 21:25:19 -0400 Original-Received: from farnswood.snap.net.nz (p236-tnt1.snap.net.nz [202.124.110.236]) by viper.snap.net.nz (Postfix) with ESMTP id B7CED4CEEF3; Sat, 7 May 2005 13:19:40 +1200 (NZST) Original-Received: by farnswood.snap.net.nz (Postfix, from userid 501) id B104262A99; Sat, 7 May 2005 02:19:59 +0100 (BST) Original-To: Luc Teirlinck In-Reply-To: <200505061456.j46EuMh11458@raven.dms.auburn.edu> X-Mailer: VM 7.19 under Emacs 22.0.50.40 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36788 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36788 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.