[Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Michele La Monaca
Hi,

It looks like a bug:

Mingw
#;1> (print 1.0 "\n" 2.0 "\n" 3.10)
1.
2.
3.1


Any other platform (I have access to)
#;1> (print 1.0 "\n" 2.0 "\n" 3.10)
1.0
2.0
3.1

Ciao,
Michele

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread John Cowan
Michele La Monaca scripsit:

> Mingw
> #;1> (print 1.0 "\n" 2.0 "\n" 3.10)
> 1.
> 2.
> 3.1

It's a deviation but not a bug.  Except for the four cases of
+inf.0, -inf.0, +nan.0, and -0.0, Chicken uses the local C's idea of
number-to-string conversion.  Since "1." is a valid Scheme inexact number,
that's perfectly fine.

-- 
How they ever reached any conclusion at all 
is starkly unknowable to the human mind.http://www.ccil.org/~cowan
--"Backstage Lensman", Randall Garrett

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Michele La Monaca
On Tue, Jul 9, 2013 at 3:44 PM, John Cowan  wrote:

> Chicken uses the local C's idea of number-to-string conversion.

Not the best approach I think. I would rather prefer a consistent behavior.

> Since "1." is a valid Scheme inexact number, that's perfectly fine.

Being a valid Scheme number it's not a valid reason to dislay it as it is, IMHO.

Michele

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread John Cowan
Michele La Monaca scripsit:

> > Chicken uses the local C's idea of number-to-string conversion.
> 
> Not the best approach I think. I would rather prefer a consistent behavior.

If you want a specific output format, use the fmt egg.

> Being a valid Scheme number it's not a valid reason to dislay it as
> it is, IMHO.

R5RS/R7RS merely require that "the result contains a decimal point
and is expressed using the minimum number of digits (exclusive of
exponent and trailing zeroes) needed to make the above expression true"
(s.v. `number->string`).  Both "1." and "1.0" satisfy that rule.

-- 
No saves, Antonio, loke es morirse en su lingua. Es komoJohn Cowan
kedarse soliko en el silensyo kada dya ke Dyo da, komo  co...@ccil.org
ser sikileoso sin saver porke.  http://www.ccil.org/~cowan
--Marcel Cohen, 1985

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Peter Bex
On Tue, Jul 09, 2013 at 05:15:31PM +0200, Michele La Monaca wrote:
> On Tue, Jul 9, 2013 at 3:44 PM, John Cowan  wrote:
> > Chicken uses the local C's idea of number-to-string conversion.
> 
> Not the best approach I think. I would rather prefer a consistent behavior.

Windows is being obnoxiously "different" here, and IIRC we've discussed
this before and decided to accept things are the way they are, because
it's just too difficult to make Windows play nice without providing a
complete implementation of number->string ourselves.  There's even a test
which is disabled on Windows because it prints numbers differently, which
is rather unfortunate.

The main problem is that none of the CHICKEN core developers use Windows
on a regular basis (or just don't use Windows, period), so nobody can put
in the effort required to make this relatively minor thing work just right.
There are worse things wrong with CHICKEN on Windows than that it prints
numbers differently!

> > Since "1." is a valid Scheme inexact number, that's perfectly fine.
> 
> Being a valid Scheme number it's not a valid reason to dislay it as it is, 
> IMHO.

It gets read back the same as if it was written with the trailing zero,
and if you write it out again you get the same output.  In my opinion,
that's not any different from UNIX, only there's a slight difference in
the default representation.  It doesn't cause any incompatibilities AFAIK.
All in all, the reasons are valid enough.  Anyway: I for one don't oppose
changing it to match the UNIX output, if you'd care to provide a patch.

Cheers,
Peter
-- 
http://www.more-magic.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Jim Ursetto
If you're really concerned about this (which is ultimately aesthetic) then you 
should consider setting flonum-print-precision to 17, which will make an actual 
difference in rare cases.  
http://api.call-cc.org/doc/library/flonum-print-precision

On Jul 9, 2013, at 10:15 AM, Michele La Monaca  
wrote:

> On Tue, Jul 9, 2013 at 3:44 PM, John Cowan  wrote:
> 
>> Chicken uses the local C's idea of number-to-string conversion.
> 
> Not the best approach I think. I would rather prefer a consistent behavior.
> 
>> Since "1." is a valid Scheme inexact number, that's perfectly fine.
> 
> Being a valid Scheme number it's not a valid reason to dislay it as it is, 
> IMHO.
> 
> Michele
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Michele La Monaca
On Tue, Jul 9, 2013 at 6:31 PM, Jim Ursetto  wrote:
> If you're really concerned about this (which is ultimately aesthetic)

Is this acceptable?

C:\TMP>chicken-status | tail -3
socket ... version: 0.2.3
srfi-37 .. version: 1.3.1
win32-msgbox  version: 1.

> then you should consider setting flonum-print-precision to 17, which will
> make an actual difference in rare
> cases.  http://api.call-cc.org/doc/library/flonum-print-precision

It doesn't seem to do any difference (in this case at least). Thanks, anyway.

Michele

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Jim Ursetto
Heh.  That is pretty amusing, but more a formatting issue on the part of 
chicken-status.  Or you could chalk it up to the egg's use of a flonum instead 
of a string or symbolic version number (0.2.3 is read as a symbol, whereas 0.2 
is read as a number).  For example, were you to use (version 1.00), it would 
read as a flonum and display "1.0" on UNIX, which is just as incorrect as "1." 
in my opinion.

One way to quickly fix this for your case is to change (version 1.0) to 
(version "1.0") in your .setup file.  I try to use string version numbers 
exclusively now for consistency's sake.

Jim

On Jul 9, 2013, at 12:12 PM, Michele La Monaca  
wrote:

> On Tue, Jul 9, 2013 at 6:31 PM, Jim Ursetto  wrote:
>> If you're really concerned about this (which is ultimately aesthetic)
> 
> Is this acceptable?
> 
> C:\TMP>chicken-status | tail -3
> socket ... version: 0.2.3
> srfi-37 .. version: 1.3.1
> win32-msgbox  version: 1.
> 
>> then you should consider setting flonum-print-precision to 17, which will
>> make an actual difference in rare
>> cases.  http://api.call-cc.org/doc/library/flonum-print-precision
> 
> It doesn't seem to do any difference (in this case at least). Thanks, anyway.
> 
> Michele


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Peter Bex
On Tue, Jul 09, 2013 at 12:56:19PM -0500, Jim Ursetto wrote:
> Heh.  That is pretty amusing, but more a formatting issue on the part of 
> chicken-status.  Or you could chalk it up to the egg's use of a flonum 
> instead of a string or symbolic version number (0.2.3 is read as a symbol, 
> whereas 0.2 is read as a number).  For example, were you to use (version 
> 1.00), it would read as a flonum and display "1.0" on UNIX, which is just as 
> incorrect as "1." in my opinion.
> 
> One way to quickly fix this for your case is to change (version 1.0) to 
> (version "1.0") in your .setup file.  I try to use string version numbers 
> exclusively now for consistency's sake.

Same here.  And what's more, flonums can't really be compared for
equality (in general), which may lead to more subtle and hard-to-find
problems.

We should probably change chicken-install to reject non-string version
numbers, but it's probably too late to do this now and may cause too
much breakage.

Cheers,
Peter
-- 
http://www.more-magic.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Felix
From: Michele La Monaca 
Subject: Re: [Chicken-users] Exact flownums not properly displayed in mingw
Date: Tue, 9 Jul 2013 19:12:58 +0200

> On Tue, Jul 9, 2013 at 6:31 PM, Jim Ursetto  wrote:
>> If you're really concerned about this (which is ultimately aesthetic)
> 
> Is this acceptable?
> 
> C:\TMP>chicken-status | tail -3
> socket ... version: 0.2.3
> srfi-37 .. version: 1.3.1
> win32-msgbox  version: 1.
> 
>> then you should consider setting flonum-print-precision to 17, which will
>> make an actual difference in rare
>> cases.  http://api.call-cc.org/doc/library/flonum-print-precision
> 
> It doesn't seem to do any difference (in this case at least). Thanks, anyway.

It can't be that hard to fix this problem. Are we just talking about adding a 
"0" in this case? I can look into this, Michele - if you can give me a hand
in testing it, since I don't have a Windows system available in the moment.


cheers,
felix

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Mario Domenech Goulart
Hi Felix and folks,

On Tue, 09 Jul 2013 22:11:28 +0200 (CEST) Felix 
 wrote:

> From: Michele La Monaca 
> Subject: Re: [Chicken-users] Exact flownums not properly displayed in mingw
> Date: Tue, 9 Jul 2013 19:12:58 +0200
>
>> On Tue, Jul 9, 2013 at 6:31 PM, Jim Ursetto  wrote:
>>> If you're really concerned about this (which is ultimately aesthetic)
>> 
>> Is this acceptable?
>> 
>> C:\TMP>chicken-status | tail -3
>> socket ... version: 0.2.3
>> srfi-37 .. version: 1.3.1
>> win32-msgbox  version: 1.
>> 
>>> then you should consider setting flonum-print-precision to 17, which will
>>> make an actual difference in rare
>>> cases.  http://api.call-cc.org/doc/library/flonum-print-precision
>> 
>> It doesn't seem to do any difference (in this case at least). Thanks, anyway.
>
> It can't be that hard to fix this problem. Are we just talking about adding a 
> "0" in this case? I can look into this, Michele - if you can give me a hand
> in testing it, since I don't have a Windows system available in the moment.

I think in that particular case the version in the .setup file should
really be a string, which should fix that issue.

If versions are represented by Scheme numbers, you always have to
predetermine a range for minor versions a priori, otherwise you end up
having, for example, a start version as 1.0, the next one 1.1 and so on,
until you reach 1.10, which is numerically equivalent to 1.1.

Maybe salmonella should issue a warning for version numbers which are
not strings.

Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Exact flownums not properly displayed in mingw

2013-07-09 Thread Michele La Monaca
On Tue, Jul 9, 2013 at 10:11 PM, Felix
 wrote:
> It can't be that hard to fix this problem. Are we just talking about adding a
> "0" in this case? I can look into this, Michele - if you can give me a hand
> in testing it, since I don't have a Windows system available in the moment.

Yes, sure.  I would have done (tried to do) it myself but ubi maior...

Thanks.

Michele

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users