all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: "Clément Pit-Claudel" <clement.pitclaudel@live.com>,
	31715@debbugs.gnu.org
Subject: bug#31715: cl-incf and cl-decf error out when passed a nil-valued variable as 'offset'
Date: Mon, 04 Jun 2018 20:12:33 -0400	[thread overview]
Message-ID: <871sdm851q.fsf@gmail.com> (raw)
In-Reply-To: <87o9gqw21y.fsf@web.de> (Michael Heerdegen's message of "Tue, 05 Jun 2018 01:43:21 +0200")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Noam Postavsky <npostavs@gmail.com> writes:
>
>> X is an optional macro parameter, so the "optionalness" applies at
>> compile time.
>
> Are you sure we always treat optional macro parameters like this?

Do DOCSTRING and DECL count?

    (defun NAME ARGLIST &optional DOCSTRING DECL &rest BODY)

Since they're obviously not evaluated, it doesn't quite feel the same.
I couldn't find any other cases of optional parameters in core macros.

There is the special form defvar's INITVALUE, but that is treated even
more specially, since it distinguishes nil from omitted.

>> I think that would approximately double the cost of cl-incf in the
>> simple case [...]

Actually, checking again, I seem to be wrong about this; the compiler
knows to elide the extra test if the increment is a constant expression,
so it would only add runtime when incrementing by a computed amount.






  reply	other threads:[~2018-06-05  0:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 20:06 bug#31715: cl-incf and cl-decf error out when passed a nil-valued variable as 'offset' Clément Pit-Claudel
2018-06-04 22:58 ` Noam Postavsky
2018-06-04 23:43   ` Michael Heerdegen
2018-06-05  0:12     ` Noam Postavsky [this message]
2018-06-05  0:40       ` Michael Heerdegen
2022-04-21 13:11         ` Lars Ingebrigtsen
2018-06-05 15:19       ` Clément Pit-Claudel
2018-06-05 22:53         ` Noam Postavsky
2018-06-05 23:01           ` Clément Pit-Claudel
2018-06-05 23:26             ` Noam Postavsky
2018-06-05 23:36               ` Clément Pit-Claudel
2018-06-06  0:32               ` Michael Heerdegen
2018-06-06  0:37                 ` Noam Postavsky
2018-06-05 15:03   ` Clément Pit-Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sdm851q.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=31715@debbugs.gnu.org \
    --cc=clement.pitclaudel@live.com \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.