From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: when should a variable to quoted? Date: Sat, 13 Sep 2008 14:29:13 +0200 Organization: Informatimago Message-ID: <87fxo49qli.fsf@hubble.informatimago.com> References: <5bdb1b73-bf04-49a3-8629-61d32ef6f899@p31g2000prf.googlegroups.com> <87k5dg9yid.fsf@hubble.informatimago.com> <48f57bb9-232f-4c11-9639-50b071cb06af@b30g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221309653 30956 80.91.229.12 (13 Sep 2008 12:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Sep 2008 12:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 13 14:41:49 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KeURc-0002lZ-40 for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Sep 2008 14:41:44 +0200 Original-Received: from localhost ([127.0.0.1]:50963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeUQb-0003qL-Ke for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Sep 2008 08:40:41 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newsserver.news.garr.it!kanaga.switch.ch!switch.ch!news.in2p3.fr!in2p3.fr!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp20-2.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:kiPkS4M+jZgbHrg8wUGWFAqT3l0= Original-Lines: 42 Original-NNTP-Posting-Date: 13 Sep 2008 14:29:13 MEST Original-NNTP-Posting-Host: 88.182.134.169 Original-X-Trace: 1221308953 news-1.free.fr 18688 88.182.134.169:49874 Original-X-Complaints-To: abuse@proxad.net Original-Xref: news.stanford.edu gnu.emacs.help:162183 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57526 Archived-At: sunway writes: > "elisp lacks of lexical variable", if this happens to the C > programming language: > int a=10; > foo(a); > may be "a" will be changed to 9 ? > > if so, I really hate this feature.... 1- not in C, but in C++ you can have: void foo(int& v){ v=0; } void f(){ int a=10; foo(a); assert(a==0); } 2- even in C, soon enough you have types such as it is possible. eg. typedef struct node { int item, struct node* next; } *Node_type; void f(void){ Node_type a=make_node(10); foo(a); assert(a->item==0); } elisp lack of lexical variables implies only that for all variable, the symbol naming that variable holds its value and can be used as a "pointer". With lexical variables, once compiled there remains no link between the symbol naming a variable and the variable. On the other hand, in these lisp we have real closures, so we can build a "pointer" also named "locative" with closures. -- __Pascal Bourguignon__ http://www.informatimago.com/ PUBLIC NOTICE AS REQUIRED BY LAW: Any use of this product, in any manner whatsoever, will increase the amount of disorder in the universe. Although no liability is implied herein, the consumer is warned that this process will ultimately lead to the heat death of the universe.