From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: never use `eval' (was: Re: How to mapcar or across a list?) Date: Wed, 15 Jul 2015 17:18:14 -0700 Message-ID: References: <87io9lmb4z.fsf@mbork.pl> <87oajdkqc7.fsf@kuiper.lan.informatimago.com> <87vbdlt4g3.fsf_-_@nl106-137-147.student.uu.se> <87bnfd2cug.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1437005936 27720 80.91.229.3 (16 Jul 2015 00:18:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jul 2015 00:18:56 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 16 02:18:48 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 1ZFWsx-0007O2-9Q for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Jul 2015 02:18:47 +0200 Original-Received: from localhost ([::1]:37884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFWsw-0000g4-DO for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Jul 2015 20:18:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFWsl-0000fw-NA for help-gnu-emacs@gnu.org; Wed, 15 Jul 2015 20:18:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFWsk-0007aS-Rr for help-gnu-emacs@gnu.org; Wed, 15 Jul 2015 20:18:35 -0400 Original-Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:33080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFWsk-0007aC-N2 for help-gnu-emacs@gnu.org; Wed, 15 Jul 2015 20:18:34 -0400 Original-Received: by oige126 with SMTP id e126so40075016oig.0 for ; Wed, 15 Jul 2015 17:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=m7PWIaz+ofMBDG6LBywI+rl0MxfiOTE42tXHCOvCe9E=; b=jMQIARGsBz5KV334+NMmq63yXCaEg4W/9m4unPTUZtGZJOTsPOdix9XRmmZoCXpegi SdnfMTUJHy1ixIYetM/PTZ/LGvxIf6D+Rveopwlv+Cb1KwH6mATqZPATrWxyvxGP4u6a xglDctEm3wn61QfBwax2CrO5kUbrTZhC7+BN9DTolOSE8/AmujjRlfhFgDlD8f8vOOM2 lVHPtmneKJmdwUoG5AhMoY7Gc68iSyeSuQQErKVIvqNf4XG+zEz4GM1Io8Thp4x7nDgX O1F/+D/z3Ok2Gjk0d1oXL7JbUKUX32C0oOJmN0P9wskxZNxotlOQbMPSX3bb4cnx0bSX 7/9A== X-Received: by 10.60.142.170 with SMTP id rx10mr6017375oeb.28.1437005914117; Wed, 15 Jul 2015 17:18:34 -0700 (PDT) Original-Received: by 10.76.168.70 with HTTP; Wed, 15 Jul 2015 17:18:14 -0700 (PDT) In-Reply-To: <87bnfd2cug.fsf@nl106-137-147.student.uu.se> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c06::229 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:105755 Archived-At: >> I would use something like this: >> >> (defmacro ... > > Macros never liked me, and that is mutual. Are they > really preferrable to `eval'? Yes, I think so. I certainly don't see any advantages to `eval' where a function or macro would work. > This is what it looks like: > > (eval `(create-book nil ,title ,@data)) > > With `apply', won't the last "data" be a list, i.e. > > (a b ... n) > > instead of > > a b ... n No, that's `funcall'. For example, these both evaluate to 6: (apply #'+ '(1 2 3)) (apply #'+ 1 2 '(3)) -- john