unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: juri@jurta.org, emacs-devel@gnu.org
Subject: Re: number-sequence
Date: Fri, 21 Nov 2003 08:43:02 -0600 (CST)	[thread overview]
Message-ID: <200311211443.hALEh2415564@raven.dms.auburn.edu> (raw)
In-Reply-To: <m38ymaapsx.fsf@kfs-l.imdomain.dk> (storm@cua.dk)

Kim Storm wrote:

   > TO is only included if there is an N for which TO = FROM + N * INC.  
   > If INC is nil, it defaults to 1 (one) if TO is larger than FROM,
   > or to -1 if TO is less than FROM.
   > If TO is nil or numerically equal to FROM, return (FROM).
   > If INC is positive and TO is less than FROM, or INC is negative
   > and TO is larger than FROM, return nil.
   > If INC is zero and TO is neither nil nor numerically equal to
   > FROM, signal an error.

   Is it really necessary to document all those cases ??

All but the first and the last two sentences specify defaults, and
hence are, I believe necessary.  I believe you suggested the first.
In case of the second to last, there might be some possibility of
expecting (FROM).  Certainly, if you are going to mention that TO is
not necessarily inclusive, it makes sense to point out the one case
where FROM is not inclusive.  The last line tells exactly when an
error is going to occur, which is not obvious in all cases, like
(number-sequence 5 nil 0) or (number-sequence 5 5 0).  They do return
(5), but could equally well have thrown an error.

   You could also suggest to use something like

	   (number-sequence 0.4 0.61 0.2)

I believe that, in real programs, the arguments might not be constant
integers.  I will add:

"Alternatively, you can, of course, also replace TO by a slightly
larger value."

to the end of the doc string.

Sincerely,

Luc.

  reply	other threads:[~2003-11-21 14:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20  3:39 number-sequence Luc Teirlinck
2003-11-20 10:39 ` number-sequence Kim F. Storm
2003-11-20 13:27 ` number-sequence Juri Linkov
2003-11-21  4:37   ` number-sequence Luc Teirlinck
2003-11-21 12:06     ` number-sequence Kim F. Storm
2003-11-21 14:43       ` Luc Teirlinck [this message]
2003-11-23 16:09   ` number-sequence Luc Teirlinck

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200311211443.hALEh2415564@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).