From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#31715: cl-incf and cl-decf error out when passed a nil-valued variable as 'offset' Date: Tue, 05 Jun 2018 19:26:51 -0400 Message-ID: <87h8mg7r2c.fsf@gmail.com> References: <1dff07f6-8da4-4e4c-a700-0bc39d6f2aa6@live.com> <874lii88hy.fsf@gmail.com> <87o9gqw21y.fsf@web.de> <871sdm851q.fsf@gmail.com> <87k1rc7sly.fsf@gmail.com> <6176bcee-a8da-8547-762b-4174652ad2a0@live.com> 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 1528241107 2270 195.159.176.226 (5 Jun 2018 23:25:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Jun 2018 23:25:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Michael Heerdegen , 31715@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 06 01:25:03 2018 Return-path: Envelope-to: geb-bug-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 1fQLK2-0000Sq-D3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jun 2018 01:25:02 +0200 Original-Received: from localhost ([::1]:49566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQLM7-0006m7-Lj for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jun 2018 19:27:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQLM1-0006lp-RM for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 19:27:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQLLy-00008X-OV for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 19:27:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQLLy-00008L-K0 for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 19:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fQLLy-0002mY-9A for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 19:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jun 2018 23:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31715 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31715-submit@debbugs.gnu.org id=B31715.152824122010686 (code B ref 31715); Tue, 05 Jun 2018 23:27:02 +0000 Original-Received: (at 31715) by debbugs.gnu.org; 5 Jun 2018 23:27:00 +0000 Original-Received: from localhost ([127.0.0.1]:35584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQLLw-0002mI-JR for submit@debbugs.gnu.org; Tue, 05 Jun 2018 19:27:00 -0400 Original-Received: from mail-it0-f47.google.com ([209.85.214.47]:52720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQLLv-0002m4-BF for 31715@debbugs.gnu.org; Tue, 05 Jun 2018 19:26:59 -0400 Original-Received: by mail-it0-f47.google.com with SMTP id m194-v6so5722159itg.2 for <31715@debbugs.gnu.org>; Tue, 05 Jun 2018 16:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=eHrII9blxWHAlkxhiaIMuq9eJnigDX2X/hNfBtzwOTQ=; b=mPST+MqsG/sqm99UagpBJTscV9NkQ+S3jUvep2Y3fBVyuwtuxQzoAjAP8/GFV1ijgp MwQcGvD1jRt6DQYBn8i4JKyw72mlqDCeV28MAByfx8PMKYZXYZ5/aSGn18ACjLj6VLYa BGbfXbiObIE8o9cbjLtBl0hI30VeYiUQqifXD3BF6KjXkt19WeuXwmbTji7v74m4gaJB BIbB1y5PShs5tsxDl9BL+jTLzlkc4NSSGginn5a4WYU1TFJHAgzqtVaom6rmdUybbo12 79gzaXEarTr47iO0TSxUt9fT8uY9IPgMmKcmkqmZdZWoueGfX7v9+IoYsoRi+RByBtPr FKJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=eHrII9blxWHAlkxhiaIMuq9eJnigDX2X/hNfBtzwOTQ=; b=EYaSZ0jpQCEVUEqyRGW1bROop2wEV91IPLnrydDx/TrZQV6mgRjMALoofiwJykgKds K4EVd+mo3XoQLDu/30eMMgN41UbxLQFOBip3w9d7VCRu3wqcPBeUA1hXk4OxNkJNewWN 8StrR5+iRu/umMr4nTgvEhTEoX9VqFvUOreDJpzeX3g5nGaWFv7X1MknpJ7E7bBzyDNy iSp3tmGTiWDO4z4+KNmj//FTbq3pNkO3yUV4jTTgYfap2Try+7zFBp/ppAiKY1xfR0jY 2VAy8/67DeyR3HHcLcDIk2qBSBIrWrcx9qlQte8Yzy3mn2DE5x5Ga6J/KlLD0izq75SO EcQA== X-Gm-Message-State: APt69E1gMqtRI8Xi80yI4ryJ5anEKl2xzdNShddjOO+iiMVaoawbpWuk v4QJj4dwaITlvQFqrIYDmN8euw== X-Google-Smtp-Source: ADUXVKI8thOgo1qiCoRM8lxi2dvvht8Re5FlTt9LkCqAK/F7ounXa+oQSKzxi9AuA2GTYv1D+ZDzpg== X-Received: by 2002:a24:43d4:: with SMTP id s203-v6mr284287itb.110.1528241213727; Tue, 05 Jun 2018 16:26:53 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id u83-v6sm6110577iod.54.2018.06.05.16.26.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 16:26:52 -0700 (PDT) In-Reply-To: <6176bcee-a8da-8547-762b-4174652ad2a0@live.com> ("=?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel"'s message of "Tue, 5 Jun 2018 19:01:56 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147048 Archived-At: Cl=C3=A9ment Pit-Claudel writes: > I'm not sure what to make of the result with SBCL and CLisp, since > (incf x nil) also fails in both of them (whereas it works for us, > since we can't distinguish nil and unspecified). Oh, huh, I didn't think to check that case. Maybe we should just change cl-incf to disintguish between nil and unspecified then. (defmacro cl-incf (place &rest args) "Increment PLACE by X (1 by default). PLACE may be a symbol, or any generalized variable allowed by `setf'. The return value is the incremented value of PLACE. \(fn PLACE &optional X)" (declare (debug (place &optional form))) (let* ((got-x (=3D (length args) 1)) (x (car args))) (if (symbolp place) (list 'setq place (if got-x (list '+ place x) (list '1+ place))) (list 'cl-callf '+ place (if got-x x 1))))) >>> In the rest of Emacs there are lots of other examples. Many of them >>> (for example semantic-find-tags-by-name or calendar-increment-month) >>> seem to work when passed a nil-valued variable, but many others behave >>> like cl-incf (for example gnus-summary-article-score). >>=20 >> I don't think those are great examples of macros to emulate. > > Agreed, I was just collecting other examples, both in support and against= my point. Yeah, I just meant we can't really use those examples either to support or argue against your point.