From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: beginnerquestion (nconc) Date: Fri, 17 Mar 2017 10:20:55 -0700 (PDT) Message-ID: <3fe53f75-8c02-4b18-bb9e-401bb1ffe0c1@default> References: <87shmc1m2u.fsf@mail.de> <87k27nzvo7.fsf@mail.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1489771305 18136 195.159.176.226 (17 Mar 2017 17:21:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Mar 2017 17:21:45 +0000 (UTC) To: Stefan Huchler , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 17 18:21:40 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1covZE-0003Jl-9G for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Mar 2017 18:21:32 +0100 Original-Received: from localhost ([::1]:50063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1covZI-0005Hr-EU for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Mar 2017 13:21:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1covYp-0005Hb-2O for help-gnu-emacs@gnu.org; Fri, 17 Mar 2017 13:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1covYl-0000Az-Ux for help-gnu-emacs@gnu.org; Fri, 17 Mar 2017 13:21:07 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:48459) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1covYl-0000AN-LV for help-gnu-emacs@gnu.org; Fri, 17 Mar 2017 13:21:03 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v2HHKxMn032511 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Mar 2017 17:20:59 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v2HHKwQN018414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Mar 2017 17:20:59 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v2HHKuX0027274; Fri, 17 Mar 2017 17:20:57 GMT In-Reply-To: <87k27nzvo7.fsf@mail.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:112594 Archived-At: > if I have to reverse, wouldnt it be easier that there is some > sort of: (yreverse sequence) that alters the sequence directly, > or overwrites it. instead of: (setq sequence (nreverse sequence)) You can write macros to do this kind of thing, if you think using the usual Lisp cliches is ugly. (defmacro my-list-var-reverse (list-var) "Set variable LIST-VAR to the reverse of its value. LIST-VAR is a symbol whose `symbol-value' is a list." `(setq ,list-var (nreverse ,list-var))) (setq aaa '(1 2 3 4)) (my-list-var-reverse 'aaa) (symbol-value 'aaa) ; =3D=3D> (4 3 2 1) (`nreverse' acts only on lists, not on sequences in general.)