From: Paul Eggert <eggert@cs.ucla.edu>
To: Gdobbins <gdobbins@protonmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Add new lisp function length= with bytecode support
Date: Mon, 27 Feb 2017 15:06:31 -0800 [thread overview]
Message-ID: <3fee7074-67f0-8fba-7fd9-0d600caf5d99@cs.ucla.edu> (raw)
In-Reply-To: <cKzLDLGYOBxnPMHR8vpzqXC4NwY38t_8KxP7qKqYoxa7SuajLW1onl22Mp3AqpKu_Mspyx3hWOnhSlzojhYM_8wIpnk-GSfiJFq1F0UbUG4=@protonmail.com>
On 02/27/2017 10:43 AM, Gdobbins wrote:
> I looked in the manual for a place where length= should be documented,
> but didn't find one. I thought the docstring was sufficient. Perhaps I
> was mistaken.
It should be documented in doc/lispref/sequences.texi, no?
As the intended use of length= is to compare lengths, it's confusing
that it also accepts markers and floats, plus that makes the
implementation a bit slower as it can't use EQ to compare lengths. It
would be cleaner and simpler for length= to accept only sequences and
integers, as Alexandria does.
I assume that markers and floats were put in only so that the
byte-compiler could optimize expressions like (= (length FOO) BAR)
without worrying about incompatibilities in the very-unlikely case where
BAR is a float or a marker. In that case, perhaps the the byte-compiler
should use a specialized length= function that is not visible to the
user, so that the user-visible function (if any) can be kept cleaner.
next prev parent reply other threads:[~2017-02-27 23:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-26 22:04 [PATCH] Add new lisp function length= with bytecode support Gdobbins
2017-02-27 16:14 ` Eli Zaretskii
2017-02-27 18:43 ` Gdobbins
2017-02-27 23:06 ` Paul Eggert [this message]
2017-02-28 0:35 ` Gdobbins
2017-02-28 9:24 ` Andreas Schwab
2017-03-06 1:59 ` Gdobbins
2017-03-06 6:13 ` Elias Mårtenson
2017-03-06 7:43 ` John Wiegley
2017-03-06 18:00 ` Richard Stallman
2017-03-06 20:36 ` Gdobbins
2017-03-06 20:45 ` Clément Pit-Claudel
2017-03-06 21:03 ` Gdobbins
2017-03-07 0:29 ` Gdobbins
2017-03-10 10:20 ` Ken Raeburn
2017-03-10 22:25 ` Gdobbins
2017-03-13 2:51 ` Gdobbins
2017-03-13 3:20 ` Stefan Monnier
2017-03-14 6:06 ` Gdobbins
-- strict thread matches above, loose matches on Subject: below --
2017-03-07 13:52 Constantin Kulikov
2017-03-08 2:00 ` Gdobbins
2017-03-08 2:46 ` Stefan Monnier
2017-03-08 3:31 ` Gdobbins
2017-03-08 4:13 ` Stefan Monnier
2017-03-08 7:01 ` Gdobbins
2017-03-08 16:47 ` Stefan Monnier
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=3fee7074-67f0-8fba-7fd9-0d600caf5d99@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=gdobbins@protonmail.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.