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: never use `eval' (was: Re: How to mapcar or across a list?) Date: Fri, 17 Jul 2015 02:55:27 +0200 Message-ID: <87fv4niow0.fsf@nl106-137-147.student.uu.se> References: <87io9lmb4z.fsf@mbork.pl> <87oajdkqc7.fsf@kuiper.lan.informatimago.com> <87zj2w29ch.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1437094641 5954 80.91.229.3 (17 Jul 2015 00:57:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jul 2015 00:57:21 +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 Jul 17 02:57:14 2015 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 1ZFtxh-0001a1-1k for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Jul 2015 02:57:13 +0200 Original-Received: from localhost ([::1]:42440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFtxg-00010r-ES for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Jul 2015 20:57:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFtxV-00010g-Ge for help-gnu-emacs@gnu.org; Thu, 16 Jul 2015 20:57:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFtxS-0002eJ-8j for help-gnu-emacs@gnu.org; Thu, 16 Jul 2015 20:57:01 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFtxS-0002e8-30 for help-gnu-emacs@gnu.org; Thu, 16 Jul 2015 20:56:58 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZFtxQ-0001VO-Fi for help-gnu-emacs@gnu.org; Fri, 17 Jul 2015 02:56:56 +0200 Original-Received: from nl106-137-156.student.uu.se ([130.243.137.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jul 2015 02:56:56 +0200 Original-Received: from embe8573 by nl106-137-156.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jul 2015 02:56:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-156.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:4OUQFvgvxMyPS3DRDcbPgC+iKbM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:105766 Archived-At: Remember when I said the byte compiler should be more offensive and offer more elaborate style warnings? And this is a good example of that! Even in the Emacs help (describe-function 'eval) it doesn't say anything about the dangers of the "nil environment": Evaluate FORM and return its value. If LEXICAL is t, evaluate using lexical scoping. LEXICAL can also be an actual lexical environment, in the form of an alist mapping symbols to their value. This book - @book{artificial-intelligence-and-the-design, title = {Artificial Intelligence and the Design of Expert Systems}, author = {George Luger and William Stubblefield}, publisher = {Benjamin-Cummings}, year = 1989, ISBN = 0805301399 } - has a chapter on LISP. One of the first things they mention is `eval', and they mention it in connection to the `quote', eval "undoing" quote so you get the feeling it is as indispensible. There are several examples using it. Their other LISP isn't that good either by the way. There are several examples where they do (car l) several times in one execution branch instead of `let'ing it be a local identifier; and, they speak appreciatively of all the different types of recursion (tail etc.) but at least so far hasn't mentioned (and will they?) anything of the drawbacks of recursion in terms of efficiency. (When I started out with Lisp, coming "closest" from SML of the languages I did then, I did recursion all the time by the way.) -- underground experts united http://user.it.uu.se/~embe8573