From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Is there a way to instrument for edebug a form (say, a progn) given to `eval'? Date: Fri, 01 Jan 2016 16:59:20 +0100 Message-ID: <87lh89uw87.fsf@gmail.com> References: <87k2nw866r.fsf@mbork.pl> <87twmxv2ad.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1451663994 5731 80.91.229.3 (1 Jan 2016 15:59:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Jan 2016 15:59:54 +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 Jan 01 16:59:48 2016 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 1aF27I-0001Go-BA for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Jan 2016 16:59:48 +0100 Original-Received: from localhost ([::1]:36152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF27H-0003C2-Td for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Jan 2016 10:59:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF277-0003Bl-9B for help-gnu-emacs@gnu.org; Fri, 01 Jan 2016 10:59:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aF273-0000E6-7z for help-gnu-emacs@gnu.org; Fri, 01 Jan 2016 10:59:37 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:55866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF273-0000E2-0s for help-gnu-emacs@gnu.org; Fri, 01 Jan 2016 10:59:33 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aF271-0000ya-OK for help-gnu-emacs@gnu.org; Fri, 01 Jan 2016 16:59:31 +0100 Original-Received: from f051054124.adsl.alicedsl.de ([78.51.54.124]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jan 2016 16:59:31 +0100 Original-Received: from tjolitz by f051054124.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jan 2016 16:59:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: f051054124.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:XL9k6TJ3KkwRGgJoZrIQ4/vzQzw= 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:108571 Archived-At: Stefan Monnier writes: >> Probably bad and slow for some Lisps with compiler, but for interpreted >> Lisps (as long as users can't abuse it)? > > The reason eval is evil has nothing to do with performance: it's > a software engineering issue. It's kind of like using nconc instead of > append, except magnified many times. I must admit I still don't get it. The arguments I find here (e.g.): ,---- | "clojure - Why exactly is eval evil? - Stack Overflow" | http://www.google.de/search?ie=UTF-8&oe=UTF-8&q=whats+wrong+with+eval+in+lisp&gws_rd=cr&ei=d5yGVrSkIIfcPNSOhIAD `---- almost all relate to compiler issues (except security and readability) ,---- | So, the answers so far are: | | * Not validating input from users and sending to eval is | evil | * Using eval I may end up with interpreted code instead | of compiled | * Eval could make code unreadable (although I think one | can write unreadable code without any "powerful" | features, so this is not much of an issue) | * Beginners may be confused mixing compile-time and | evaluation-time when mixing eval and macros (but I | think it's not an issue once you get a firm grasp of | how your language works -- be it Lisp or other) `---- In another related post ,---- | http://blog.racket-lang.org/2011/10/on-eval-in-dynamic-languages-generally.html `---- again the compiler argument seems to be the most reasonable: " [...] a program that uses eval. It can't be compiled and optimized as well as the earlier paragraph, and the language context in which it is run may change the result." But in an interpreted Lisp without a Compiler, moving around lists as data and 'eval' them at some point still appears like a great feature to make programs short and readable to me. -- cheers, Thorsten