From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.help Subject: Re: Is add-to-list supposed to work when lexical-binding is t? Date: Tue, 4 Jun 2013 08:24:04 -0700 Message-ID: References: <1370306529.4188.YahooMailClassic@web141101.mail.bf1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1370359479 32492 80.91.229.3 (4 Jun 2013 15:24:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Jun 2013 15:24:39 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 04 17:24:40 2013 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 1Ujt6G-0007E4-Dd for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jun 2013 17:24:40 +0200 Original-Received: from localhost ([::1]:43187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujt6G-0005Dp-0K for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jun 2013 11:24:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujt5w-000597-36 for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 11:24:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ujt5i-0001Zj-CI for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 11:24:19 -0400 Original-Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:57082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujt5i-0001ZK-5m for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 11:24:06 -0400 Original-Received: by mail-ee0-f54.google.com with SMTP id b45so113295eek.13 for ; Tue, 04 Jun 2013 08:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=bFwGqhx1vt5MJzSguoXbUYBrA+YY++h0i0wZn8/R59s=; b=dwOxmVS1QLmvybEIzxJ6W80mKX0B/9hZ+bWR/JzXLtV7FBePlxjPknXFD5QjEpogLQ /AT5sc6NIDHELNktY9Qao15dvX1cQY1qpeSTl8Mi5T1/HqHqd6LEZYci9vqBajszfsqK 0z6W2FIqStjhhdLkksRB0z7vpjfNfvcwRiyGuT6IXCvMl9T8xJ4xMNOsZdPgfjRBQsuU jnDzvlLk/1Xkjdg9xashUmIJZiYaMQdtHdi9Pc0pyxaF+25iARpsT+AQubQXm8j3z94F yG4mlxGFUkqGN3M/vdAGDGVb8zgJ/Lqjbk0OZizV60DePiNSm/9EMlwpj81CZAgTW+Y1 WqHQ== X-Received: by 10.15.54.198 with SMTP id t46mr945134eew.74.1370359444853; Tue, 04 Jun 2013 08:24:04 -0700 (PDT) Original-Received: by 10.223.51.89 with HTTP; Tue, 4 Jun 2013 08:24:04 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: Z4PU5WxJ2pKUjgq925QLS52BNog X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::236 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:91295 Archived-At: On Mon, Jun 3, 2013 at 6:49 PM, Stefan Monnier wrote: > > > (let ((x '(a))) (add-to-list 'x 'b) x) -> (b a) > > Yup, this is asking for trouble. Use `push' or `cl-pushnew' instead. > > Unless you're knee-deep in the internals of the language, the difference between `cl-pushnew' and `add-to-list' is so obscure as to be incomprehensible. -PJ Gehm's Corollary to Clark's Law: Any technology distinguishable from magic is insufficiently advanced.