unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Freja Nordsiek <fnordsie@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Add preliminary versions of the R7RS libraries along with documentation and tests
Date: Sun, 28 May 2017 19:12:50 -0400	[thread overview]
Message-ID: <87efv81sp9.fsf@netris.org> (raw)
In-Reply-To: <CAOqf98rMj1hHTUXv2nJgYaN=dqERg7DtPttj+nGprEar32hqNA@mail.gmail.com> (Freja Nordsiek's message of "Sun, 28 May 2017 15:35:10 +0200")

Hi Freja,

Freja Nordsiek <fnordsie@gmail.com> writes:
> I went through the patch and cleaned up a lot of little things (line
> length in documentation, two spaces between sentences in
> documentation, trailing spaces, etc.), made a proper commit
> comment/log, and replaced the very ugly bytevector output port hack
> with a cleaner and simpler hack (just used string output ports with
> get-output-bytevector reading the input with the ISO-8859-1 encoding
> and then converting to a bytevector).

I very much appreciate the documentation work you've done here, but I'm
puzzled why you would rewrite most of the code I wrote for the r7rs-wip
branch.  Now that you've done this, whose code would you propose should
get dumped into the proverbial bit bucket?

A quick perusal of your code suggests that you did not take the same
care as I did to account for the sometimes subtle differences in
specified functionality of procedures of the same name.

For example, the R7RS 'map' procedure is specified to terminate when the
shortest list runs out, and also to allow circular lists as long as
there is at least one finite list among the arguments.  In my code, I
made sure that the 'map' in (scheme base) matches this specification.
Your code simply re-exports Guile's native 'map', which requires that
lists are finite and of the same length.

Your 'string->vector', 'vector->string', 'string-map', 'string-for-each'
and many similar procedures are written in a very simple way that
involves a lot of needless allocation of intermediate data structures
such as 'rest' argument lists, and lists of characters from a string,
whereas my versions are written to be reasonably efficient.

Your 'finite?', 'infinite?' and 'nan?' procedures are simply re-exported
from Guile's core, although the semantics are different.  The guile
versions are only defined on real numbers, but the R7RS variants are
defined on all complex numbers.  

R7RS 'bytevector-copy' can accept up to three arguments (bv start end),
but you simply reuse the one from R6RS which only accepts one argument.

Your 'vector-map' and 'vector-for-each' are simply wrong.  You re-export
the same procedures from SRFI-43, but in fact they differ from the R7RS
semantics in a crucial respect: the SRFI-43 versions of 'vector-map' and
'vector-for-each' call the provided procedure 'f' with the 'index' as an
additional argument, whereas the R7RS versions do not.

I could go on.

Having said all of this, I'm grateful for your documentation.  How would
you feel about preparing a patch to add your documentation to the
existing r7rs-wip branch?

     Regards,
       Mark



  reply	other threads:[~2017-05-28 23:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 21:13 [PATCH] Add preliminary versions of the R7RS libraries along with documentation and tests Freja Nordsiek
2017-03-10  0:50 ` Christopher Allan Webber
2017-03-10  0:52 ` Julian Graham
2017-03-10  8:24 ` Andy Wingo
2017-03-10 10:36   ` Freja Nordsiek
2017-03-11 12:11 ` Taylan Ulrich Bayırlı/Kammer
2017-03-11 12:17   ` Taylan Ulrich Bayırlı/Kammer
2017-05-28 13:35 ` Freja Nordsiek
2017-05-28 23:12   ` Mark H Weaver [this message]
2017-05-29  5:57     ` Freja Nordsiek
2017-05-29 22:02       ` Mark H Weaver
2017-06-17  0:02         ` Freja Nordsiek
2017-06-18 10:42           ` Freja Nordsiek
2017-06-19  6:03           ` Mark H Weaver
2017-06-19  6:31             ` Freja Nordsiek
2017-06-19 17:13               ` Mark H Weaver
2017-06-19 19:15                 ` Freja Nordsiek

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=87efv81sp9.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=fnordsie@gmail.com \
    --cc=guile-devel@gnu.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.
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).