From: Karl Fogel <kfogel@red-bean.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: tom@tromey.com, Pip Cet <pipcet@gmail.com>, emacs-devel@gnu.org
Subject: Some vars now limited to fixnum size. (Was: Merging bignum to master)
Date: Mon, 20 Aug 2018 11:28:45 -0500 [thread overview]
Message-ID: <878t51t32a.fsf_-_@red-bean.com> (raw)
In-Reply-To: <b271c161-e468-353c-c2fb-bee9ca3ff447@cs.ucla.edu> (Paul Eggert's message of "Tue, 14 Aug 2018 11:01:41 -0700")
On 'master' as of commit ecd7a94077, if you do this:
(setq mark-ring-max (1+ most-positive-fixnum))
then any command that calls `push-mark' will raise an error:
Wrong type argument: fixnump, 2305843009213693952
(Lots of common commands do, obviously: `beginning-of-buffer', `yank', etc.)
The root cause is in `nthcdr', which now requires a fixnum for its first argument, although this requirement is not documented:
DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0,
doc: /* Take cdr N times on LIST, return the result. */)
(Lisp_Object n, Lisp_Object list)
{
CHECK_FIXNUM (n);
[...]
}
Should we document this? I haven't followed the fixnum thread(s) carefully -- has the issue of documenting fixnum requirements has already been raised and settled?
My proposal would be to at least document it for `nthcdr', so that anyone who traces down the documentation stack down from this backtrace can see what happened without having to look at the C source code itself. I don't know how many other primitives are affected, but `nthcdr' seems like a major one. However, if this has already been discussed, and we've decided that fixnum is a reasonable requirement for many functions, and does not need to be documented specially, then that's fine. (As to why I was setting `mark-ring-max' so high as to run into this issue, that's a long story and not relevant here :-) .)
Best regards,
-Karl
Paul Eggert <eggert@cs.ucla.edu> writes:
>Pip Cet wrote:
>> Is it intentional that int-forwarded variables are still limited to
>> the fixnum range? In any case, we probably didn't want to rename
>> XINTFWD to XFIXNUMFWD...
>
>I think some C code does assume fixnum ranges for these variables, and
>would have to be inspected. Presumably we'd go to either intmax_t
>range or Emacs integers (fixnums or bignums), and that might need to
>be thought through in a case-by-case basis. In the meantime XFIXNUMFWD
>is probably a good name since that's effectively what the code does
>now.
next prev parent reply other threads:[~2018-08-20 16:28 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-11 19:47 Merging bignum to master Tom Tromey
2018-08-11 21:28 ` Basil L. Contovounesios
2018-08-12 16:34 ` Tom Tromey
2018-08-13 12:21 ` Basil L. Contovounesios
2018-08-14 0:21 ` Andy Moreton
2018-08-15 23:41 ` Andy Moreton
2018-08-16 15:38 ` Basil L. Contovounesios
2018-08-19 8:26 ` Paul Eggert
2018-08-17 14:58 ` Eli Zaretskii
2018-08-12 6:29 ` Ulrich Mueller
2018-08-12 8:09 ` Paul Eggert
2018-08-12 17:21 ` Ulrich Mueller
2018-08-12 18:20 ` Eli Zaretskii
2018-08-12 19:30 ` Ulrich Mueller
2018-08-13 0:15 ` Paul Eggert
2018-08-12 18:05 ` Eli Zaretskii
2018-08-12 23:53 ` Paul Eggert
2018-08-13 0:20 ` Tom Tromey
2018-08-13 7:51 ` Andreas Schwab
2018-08-13 8:06 ` Ulrich Mueller
2018-08-13 9:14 ` Paul Eggert
2018-08-14 23:09 ` Paul Eggert
2018-08-16 2:46 ` Richard Stallman
2018-08-13 23:31 ` Richard Stallman
2018-08-14 1:41 ` Paul Eggert
2018-08-16 2:41 ` Richard Stallman
2018-08-16 19:31 ` Paul Eggert
2018-08-16 22:02 ` Stefan Monnier
2018-08-12 7:37 ` John Wiegley
2018-08-12 18:21 ` Eli Zaretskii
2018-08-12 11:48 ` Pip Cet
2018-08-12 16:02 ` Tom Tromey
2018-08-13 22:58 ` Paul Eggert
2018-08-14 1:12 ` Noam Postavsky
2018-08-14 13:04 ` Pip Cet
2018-08-14 18:01 ` Paul Eggert
2018-08-15 15:20 ` Pip Cet
2018-08-15 16:17 ` Paul Eggert
2018-08-15 23:57 ` Andy Moreton
2018-08-16 22:00 ` Stefan Monnier
2018-08-20 16:28 ` Karl Fogel [this message]
2018-08-20 16:54 ` Some vars now limited to fixnum size. (Was: Merging bignum to master) Paul Eggert
2018-08-20 17:27 ` Eli Zaretskii
2018-08-20 17:27 ` Paul Eggert
2018-08-20 18:00 ` Eli Zaretskii
2018-08-20 19:55 ` Pip Cet
2018-08-20 23:15 ` Paul Eggert
2018-08-21 15:01 ` Some vars now limited to fixnum size Tom Tromey
2018-08-21 16:36 ` Andy Moreton
2018-08-21 18:46 ` Paul Eggert
2018-08-22 15:39 ` Tom Tromey
2018-08-21 3:38 ` Some vars now limited to fixnum size. (Was: Merging bignum to master) Richard Stallman
2018-08-21 4:09 ` Paul Eggert
2018-08-22 4:03 ` Richard Stallman
2018-08-22 4:53 ` Paul Eggert
2018-08-20 17:25 ` Eli Zaretskii
2018-08-14 0:51 ` Merging bignum to master Andy Moreton
2018-08-15 15:46 ` Andy Moreton
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=878t51t32a.fsf_-_@red-bean.com \
--to=kfogel@red-bean.com \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=pipcet@gmail.com \
--cc=tom@tromey.com \
/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.