Re: [Chicken-users] Using fmt and numbers eggs together

2016-01-05 Thread Alex Shinn
On Sun, Jan 3, 2016 at 1:48 AM, Peter Bex  wrote:

> On Sat, Jan 02, 2016 at 11:40:47AM -0500, Sudarshan S Chawathe wrote:
> > I seem to get incorrect output and errors in some cases when using the
> > fmt and numbers eggs together.  A brief transcript illustrating the
> > problem is included below.  In brief:
> >
> >   * (fix 30 2/3) doesn't behave as indicated in the docs.
> >
> >   * Some large numbers cause errors.
> >
> > When not using the numbers egg, fmt's behavior seems to be as expected
> > (given Chicken's implementation of numbers without the 'numbers' egg).
> >
> > Is this a known limitation of fmt with 'numbers'?
>
> I'm afraid so.  As far as I know the only way to fix this is to add a
> hard dependency on numbers to fmt.  This may not be desirable depending
> on what you're using fmt for.
>
> This is a result of the second class treatment that extended numbers get,
> and will be fixed in CHICKEN 5, due to integration of the full numeric
> tower into core.
>

Note this is in contrast to how 'numbers' used to work, where
loading it overloaded all numeric operations globally.  The fmt
documentation still reflects this previous behavior.

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


Re: [Chicken-users] Using fmt and numbers eggs together

2016-01-02 Thread Sudarshan S Chawathe
John Cowan  wrote:

> Since the fmt egg is compiled without the numbers egg, it only recognizes
> native Chicken numbers, i.e. fixnums and flonums.  The way to fix that
> is to fetch the fmt egg, introduce "(use numbers)" into the appropriate
> places, and rebuild the egg locally.

Thanks to the above suggestion, as well as the earlier message from
Peter Bex,  I seem to have gotten the fmt and numbers eggs to work
properly together.  At least, the earlier errors are gone.

In the process, I have probably inserted '(use numbers)' in a few
unnecessary places in my copy of the fmt source files.  At first I
thought I should be able to manage by editing only the compiler flags in
fmt.setup (-prelude, etc.), but that didn't work.

Regards, and thanks for the help,

-chaw

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


Re: [Chicken-users] Using fmt and numbers eggs together

2016-01-02 Thread John Cowan
Sudarshan S Chawathe scripsit:

> When not using the numbers egg, fmt's behavior seems to be as expected
> (given Chicken's implementation of numbers without the 'numbers' egg).

Since the fmt egg is compiled without the numbers egg, it only recognizes
native Chicken numbers, i.e. fixnums and flonums.  The way to fix that
is to fetch the fmt egg, introduce "(use numbers)" into the appropriate
places, and rebuild the egg locally.

> Is this a known limitation of fmt with 'numbers'?

It's a limitation of the numbers egg: programs (other than csi itself)
have to be compiled with it to work with it.  Chicken 5 will make
this go away, fortunately.

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
Let's face it: software is crap. Feature-laden and bloated, written under
tremendous time-pressure, often by incapable coders, using dangerous
languages and inadequate tools, trying to connect to heaps of broken or
obsolete protocols, implemented equally insufficiently, running on
unpredictable hardware -- we are all more than used to brokenness.
   --Felix Winkelmann

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


Re: [Chicken-users] Using fmt and numbers eggs together

2016-01-02 Thread Peter Bex
On Sat, Jan 02, 2016 at 11:40:47AM -0500, Sudarshan S Chawathe wrote:
> I seem to get incorrect output and errors in some cases when using the
> fmt and numbers eggs together.  A brief transcript illustrating the
> problem is included below.  In brief:
> 
>   * (fix 30 2/3) doesn't behave as indicated in the docs.
> 
>   * Some large numbers cause errors.
> 
> When not using the numbers egg, fmt's behavior seems to be as expected
> (given Chicken's implementation of numbers without the 'numbers' egg).
> 
> Is this a known limitation of fmt with 'numbers'?

I'm afraid so.  As far as I know the only way to fix this is to add a
hard dependency on numbers to fmt.  This may not be desirable depending
on what you're using fmt for.

This is a result of the second class treatment that extended numbers get,
and will be fixed in CHICKEN 5, due to integration of the full numeric
tower into core.

Cheers,
Peter


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