all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: monnier@iro.umontreal.ca, 34781@debbugs.gnu.org
Subject: bug#34781: 27.0.50; integer in pcase sometimes compared by eq
Date: Thu, 28 Mar 2019 15:10:14 -0700	[thread overview]
Message-ID: <ca9aff3f-f754-a090-0a83-b3b47a72e5d5@cs.ucla.edu> (raw)
In-Reply-To: <3a02a3378a526c8706b33f36b85c003a82aa2aa1.camel@acm.org>

>
> +Since the size of fixnums varies between platforms, the new predicate
> +'portable-fixnum-p' can be used to determine whether a number is
> +a fixnum on any machine running the current Emacs version.

The news item should also mention most-negative-portable-fixnum etc. Try
to be terser; e.g., "can be used to determine" -> "determines".


>
> +(defun portable-fixnum-p (object)
> +  "Return t if OBJECT is a fixnum on any machine running the current
> +Emacs version."

The usage message can fit on one line.

> +  (and (integerp object)
> +       (<= most-negative-portable-fixnum object
> most-positive-portable-fixnum)))

integerp -> fixnump


> +  DEFVAR_LISP ("most-positive-portable-fixnum",
> +               Vmost_positive_portable_fixnum,
> +               doc: /* The greatest integer that is represented
> efficiently
> +on any machine running this version of Emacs.

Try to have the first line explain things tersely. Something like "The
largest integer representable as a fixnum on any platform." More details
can be in later lines, if needed.

> +  Vmost_positive_portable_fixnum =
> make_fixnum(MOST_POSITIVE_PORTABLE_FIXNUM);

Space before parenthesis (elsewhere, too).


>
> diff --git a/src/lisp.h b/src/lisp.h
> index 178eebed2a..bf1f0a0bf5 100644
> --- a/src/lisp.h
> +++ b/src/lisp.h

These changes should be in data.c not lisp.h, since only data.c needs
them and it's not likely any other code will need them.


>
> +/* The smallest portable value of EMACS_INT_MAX.  */
> +#define LEAST_EMACS_INT_MAX 2147483647   /* 2**31 - 1 */

There's no need to make it a macro. Also, the LEAST_* prefix and *_MAX
suffix are confusing: which takes priority? I suggest sticking to
suffixes, since that seems to be the convention. Something like

  int EMACS_INT_MAX_MIN = 2147483647;

as a local in the only function that needs it, and similarly for the
related macros. Although you can use 'verify' to check that
EMACS_INT_MAX_MIN <= EMACS_INT_MAX, I'm not sure I'd bother as we're
going to add overflow checking to make_fixnum at some point anyway.

This stuff should be documented in the manual, too, next to the
documentation of most-positive-fixnum and fixnump respectively.

Thanks again for taking this on.






  reply	other threads:[~2019-03-28 22:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 15:13 bug#34781: 27.0.50; integer in pcase sometimes compared by eq Mattias Engdegård
     [not found] ` <handler.34781.B.15519717565134.ack@debbugs.gnu.org>
2019-03-12 12:24   ` bug#34781: Acknowledgement (27.0.50; integer in pcase sometimes compared by eq) Mattias Engdegård
2019-03-16 19:09     ` bug#34781: 27.0.50; integer in pcase sometimes compared by eq Mattias Engdegård
2019-03-28 18:25 ` Paul Eggert
2019-03-28 19:47   ` Michael Heerdegen
2019-03-28 20:33     ` Paul Eggert
2019-03-28 21:30       ` Michael Heerdegen
2019-03-28 19:51   ` Mattias Engdegård
2019-03-28 20:30     ` Paul Eggert
2019-03-28 21:51       ` Mattias Engdegård
2019-03-28 22:10         ` Paul Eggert [this message]
2019-03-28 22:11         ` Stefan Monnier
2019-03-28 22:20           ` Mattias Engdegård
2019-03-28 22:38             ` Paul Eggert
2019-03-28 23:03               ` Mattias Engdegård
2019-03-29  8:48         ` Eli Zaretskii
2019-03-29  9:52           ` Mattias Engdegård
2019-03-29 12:33             ` Eli Zaretskii
2019-03-28 19:43 ` Michael Heerdegen

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=ca9aff3f-f754-a090-0a83-b3b47a72e5d5@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=34781@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    /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.