From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: how to add button to emacs that play a elisp code Date: Fri, 12 Sep 2014 04:07:37 +0200 Organization: Aioe.org NNTP Server Message-ID: <87sijxtwuu.fsf@debian.uxu> References: <04dd6007-693a-4e56-9e2a-e930e51a9563@googlegroups.com> <21521.22678.640570.26495@mail.eng.it> <21521.24551.904371.551048@mail.eng.it> <21521.37886.262510.961741@mail.eng.it> <87vbotx3ht.fsf@debian.uxu> <87ioktn2qp.fsf@kuiper.lan.informatimago.com> <87d2b1vh2w.fsf@debian.uxu> <87wq99u0g1.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410487825 10839 80.91.229.3 (12 Sep 2014 02:10:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2014 02:10:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 12 04:10:18 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XSGJW-0007uV-J4 for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 04:10:18 +0200 Original-Received: from localhost ([::1]:42014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSGJW-0006Ej-0q for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Sep 2014 22:10:18 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: P0uMB9BthHuWo8+BJXB4Mw.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:N4/P7TxCEFfR2w4yaExSwybPaVM= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:207564 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99839 Archived-At: Michael Heerdegen writes: > You may argue that you can avoid destructive > operations like `nconc' in your code to prevent that > problem. I was just about to say that - almost. While I don't think side effects are bad by definition, and I disklike the whole functional paradigm crusade with the Haskell hysteria and all, in practise it makes sense most of the time. But that is more related to your specific example than to the problem, right? > But that isn't enough either: when you pass your list > to some function you didn't define yourself (e.g. a > function that is part of Emacs), it is passed as > reference (as usual in Lisp), and it may be modified > by that function by side effect, so that your program > "changes" too. > > If you are not aware of that problem, it probably > won't bite you often, but when it does, you'll need a > lot of time to find out what's actually going on. > > BTW, this "effect" can also be used constructively, > it's not "harmful" per se. No, I have lots of quoted, and even backquoted stuff, which would have showed its harmful side by now, so I suppose I have been using it either "constructively" or where it doesn't matter which. By the way - computer science silly buzzword: idempotence, or "referential transparency". -- underground experts united