From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rolf Ade Newsgroups: gmane.emacs.tangents Subject: Re: 2016-05-23 Emacs News Date: Fri, 10 Jun 2016 15:37:10 +0200 Organization: Me Message-ID: <8737oldv21.fsf@linux-qg7d.fritz.box> References: <87lh30iv18.fsf@sachachua.com> <87bn39ewp6.fsf@linux-qg7d.fritz.box> <87twh1gwu8.fsf@members.fsf.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1465565881 20591 80.91.229.3 (10 Jun 2016 13:38:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 13:38:01 +0000 (UTC) To: emacs-tangents@gnu.org Original-X-From: emacs-tangents-bounces+get-emacs-tangents=m.gmane.org@gnu.org Fri Jun 10 15:37:52 2016 Return-path: Envelope-to: get-emacs-tangents@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 1bBMd5-0006lS-OP for get-emacs-tangents@m.gmane.org; Fri, 10 Jun 2016 15:37:44 +0200 Original-Received: from localhost ([::1]:41182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBMd5-0003xv-4d for get-emacs-tangents@m.gmane.org; Fri, 10 Jun 2016 09:37:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBMcq-0003v3-PS for emacs-tangents@gnu.org; Fri, 10 Jun 2016 09:37:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBMcm-0000B2-IS for emacs-tangents@gnu.org; Fri, 10 Jun 2016 09:37:27 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:52033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBMcm-0000Ax-B8 for emacs-tangents@gnu.org; Fri, 10 Jun 2016 09:37:24 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bBMck-0006Ug-OC for emacs-tangents@gnu.org; Fri, 10 Jun 2016 15:37:22 +0200 Original-Received: from p4ffbfc1c.dip0.t-ipconnect.de ([79.251.252.28]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Jun 2016 15:37:22 +0200 Original-Received: from rolf by p4ffbfc1c.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Jun 2016 15:37:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p4ffbfc1c.dip0.t-ipconnect.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:8nX0GXhMHBHC+YZHQMBt5JjyA5E= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-tangents@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-tangents-bounces+get-emacs-tangents=m.gmane.org@gnu.org Original-Sender: "Emacs-tangents" Xref: news.gmane.org gmane.emacs.tangents:131 Archived-At: Nicolas Richard writes: > Rolf Ade writes: >> (That is: >> http://mbork.pl/2016-05-23_Literal_values_and_destructive_functions) >> >> Wait, what? >> [...] >> in *Messages*. Could someone please explain that to me? > > The article you're referring to explains just that. Is it somehow > unclear ? Quoting the article: > > | What’s going on? > | > | Well, the literal in the function definition was actually changed. (If > | you evaluate the defun form now, it will be redefined once again to > | the “correct” value.) If you don’t believe it, try this: M-: > | (symbol-function #'destructive-havoc), or even better, M-x > | pp-eval-expression RET (symbol-function #'destructive-havoc) RET and > | see for yourself. Well ..., sorry, yes, that explanation isn't clear to me. While I'm far away to claim I'm a versed emacs lisp programmer, I've written a few screen full of emacs lisp code. Now this thing left me back with the feeling, that I've missed to understand something at the core of the language (with the additional unpleasant feeling, that my emacs lisp programming is even more cargo cult coding, than I already suspected). The "explanation", that the literal in the function definition was changed by the (sort) call doesn't help me on track. While I'm fluent with other programming languages, that are able to rewrite function definitions during run-time I don't know a programming language that do this as a 'side effect' of a function call (other than you craft one, that deliberate does so). Is what the article demonstrates something special to the 'build-in' function sort or to emacs lisp? It would help me, if someone explains what happen in this example in other words (not in implementation detail but language concepts).