From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Sprang Subject: Re: [PATCH] build: Fix potential type error when generating human-friendly byte count strings. Date: Mon, 14 Sep 2015 20:27:48 -0700 Message-ID: References: <87a8svuh8w.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113e57d226ec39051fc0c42b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbguN-0004W0-Pv for guix-devel@gnu.org; Mon, 14 Sep 2015 23:27:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbguM-0003Tf-JV for guix-devel@gnu.org; Mon, 14 Sep 2015 23:27:51 -0400 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:33633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbguM-0003TA-9S for guix-devel@gnu.org; Mon, 14 Sep 2015 23:27:50 -0400 Received: by oixx17 with SMTP id x17so88066154oix.0 for ; Mon, 14 Sep 2015 20:27:48 -0700 (PDT) In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org --001a113e57d226ec39051fc0c42b Content-Type: text/plain; charset=UTF-8 Hi Mark, Does the updated patch look okay? I'm making some related changes and it would be easier if this patch was integrated. Thanks! -Steve On Wed, Sep 9, 2015 at 8:31 PM, Steve Sprang wrote: > Sure thing. Here you go. > > -Steve > > On Wed, Sep 9, 2015 at 7:42 PM, Mark H Weaver wrote: > >> Steve Sprang writes: >> >> > This is a follow up tweak to my previous "progress bar" patch. With a >> > really slow throughput it's possible to get fractional sub-KiB byte >> > counts, so I added some additional number massaging. >> >> Sounds good! Looks good to me except for a few minor nits on this >> auxiliary procedure: >> >> > +(define (number->integer n) >> > + "Given an arbitrary number N, round it and return the exact result." >> > + (inexact->exact (round n))) >> >> How about calling it "nearest-exact-integer"? Also, it makes sense only >> for real numbers, not arbitrary numbers, and the variable name N is >> conventionally used to denote natural numbers, and X for real numbers. >> >> So, how about naming the argument 'x', and using something closer to the >> following docstring: >> >> "Given a real number X, return the nearest exact integer, with ties >> going to the nearest exact even integer." >> >> Otherwise, looks good to me. Can you send an updated patch? >> >> Mark >> > > --001a113e57d226ec39051fc0c42b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Mark,

Does the updated patc= h look okay? I'm making some related changes and it would be easier if = this patch was integrated.

Thanks!
-Steve


On Wed, Sep 9, = 2015 at 8:31 PM, Steve Sprang <steve.sprang@gmail.com> = wrote:
Sure thing. = Here you go.

<= /span>
-Steve

On Wed, Sep 9, 2015 at 7:42 PM, Mark H= Weaver <mhw@netris.org> wrote:
Steve Sprang <steve.sprang@gmail.com> writes:

> This is a follow up tweak to my previous "progress bar" patc= h. With a
> really slow throughput it's possible to get fractional sub-KiB byt= e
> counts, so I added some additional number massaging.

Sounds good!=C2=A0 Looks good to me except for a few minor nits on t= his
auxiliary procedure:

> +(define (number->integer n)
> +=C2=A0 "Given an arbitrary number N, round it and return the exa= ct result."
> +=C2=A0 (inexact->exact (round n)))

How about calling it "nearest-exact-integer"?=C2=A0 Also, it make= s sense only
for real numbers, not arbitrary numbers, and the variable name N is
conventionally used to denote natural numbers, and X for real numbers.

So, how about naming the argument 'x', and using something closer t= o the
following docstring:

=C2=A0 "Given a real number X, return the nearest exact integer, with = ties
going to the nearest exact even integer."

Otherwise, looks good to me.=C2=A0 Can you send an updated patch?

=C2=A0 =C2=A0 =C2=A0 Mark


--001a113e57d226ec39051fc0c42b--