unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Ian Hulin <ian@hulin.org.uk>
To: 11262@debbugs.gnu.org
Cc: alexei.matveev@gmail.com
Subject: bug#11262: help text fro sorted? predicate is wrong/misleading.
Date: Sun, 22 Apr 2012 11:29:23 +0100	[thread overview]
Message-ID: <4F93DD83.3070504@hulin.org.uk> (raw)
In-Reply-To: <87r4vgveo6.fsf@gnu.org>

Hi Ludo, Alexei,
Please avoid C-speak in documentation if possible.
(See below)

On 22/04/12 00:38, Ludovic Courtès wrote:
> Hi Alexei,
> 
> (Removing Cc: guile-devel.)
> 
> Thanks for the patch!
> 
> Alexei Matveev <alexei.matveev@gmail.com> skribis:
> 
>> --- a/libguile/sort.c +++ b/libguile/sort.c @@ -101,9 +101,10 @@
>> SCM_DEFINE (scm_restricted_vector_sort_x,
>> "restricted-vector-sort!", 4, 0, 0, * (not (less? (list-ref list
>> i) (list-ref list (- i 1)))). */ SCM_DEFINE (scm_sorted_p,
>> "sorted?", 2, 0, 0, (SCM items, SCM less), -	    "Return
>> @code{#t} iff @var{items} is a list or a vector such that\n" -
>> "for all 1 <= i <= m, the predicate @var{less} returns true
>> when\n" -	    "applied to all elements i - 1 and i") +
>> "Return @code{#t} iff @var{items} is  a list or a vector such\n" 
>> +	    "that for all  1 <= i <= m,  the predicate @var{less}
>> returns\n" +	    "@code{#f} when comparing element i to the
>> preceeding element\n" +	    "i - 1.")
> 
> How about this:
> 
> Return @code{#t} iff @var{items} is a list or vector such that, for
> each element @var{x} and the next element @var{y} of @var{items}, 
> @code{(@var{less} @var{x} @var{y})} returns @code{#f}.
> 
> This avoids use of ‘m’, which would need to be defined, and makes
> it clear what “comparing element i to the preceeding element”
> means.
> 
> What do you think?
> 

Please spell out iff, which I presume means "if-and-only-if".  The
reason is that on first reading it looks ambiguous to old dinosaurs
like me who may have experience of programming languages using iff as
a token for "if-false" back in the Jurassic period.

Or maybe say:

Return @code{#t} when @var{items} is a list or vector such that,
   for each element @var{x} and the next element @var{y} of @var{items},
   @code{(@var{less} @var{x} @var{y})} returns @code{#f}.


Cheers,
Ian Hulin






  reply	other threads:[~2012-04-22 10:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 10:07 bug#11262: help text fro sorted? predicate is wrong/misleading Alexei Matveev
2012-04-19  1:14 ` Noah Lavine
     [not found] ` <CA+U71=NSwOYZSiKbxqgpX5CLzA8LbXKizR5mmN9HJTrHSZu0Lw@mail.gmail.com>
2012-04-20 10:20   ` Alexei Matveev
2012-04-21 23:38     ` Ludovic Courtès
2012-04-22 10:29       ` Ian Hulin [this message]
2012-04-22 10:36         ` Ludovic Courtès
2012-04-22 10:53         ` Alexei Matveev
2012-04-22 12:53           ` Ludovic Courtès
2012-04-26  7:31             ` Marijn
2012-04-27  2:34               ` Noah Lavine

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/guile/

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

  git send-email \
    --in-reply-to=4F93DD83.3070504@hulin.org.uk \
    --to=ian@hulin.org.uk \
    --cc=11262@debbugs.gnu.org \
    --cc=alexei.matveev@gmail.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.
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).