[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] New division operators, and optimization for fractions
From: |
Andy Wingo |
Subject: |
Re: [PATCH] New division operators, and optimization for fractions |
Date: |
Mon, 14 Feb 2011 20:44:18 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
On Sun 13 Feb 2011 15:55, Mark H Weaver <address@hidden> writes:
> I have a new version of the patch set which I believe addresses all of
> your (quite reasonable) concerns. The second patch changes the API of
> the existing multi-valued operators as you suggest. The third optimizes
> the fraction case. The fourth adds the new division operators. The
> fifth optimizes the existing truncate/round/floor/ceiling unary
> operators.
>
> The sixth patch removes a lot of code, by implementing division
> operators in terms of other division operators.
>
> The other notable patch is the last one, which is unrelated to numerics,
> but it addresses a problem I discovered while implementing a complex
> number class in GOOPS. Suppose you define the following class within a
> module:
>
> (define-class <gcomplex> ()
> (real-part #:getter real-part #:init-keyword #:real-part)
> (imag-part #:getter imag-part #:init-keyword #:imag-part))
>
> There's no way I have found to make this work correctly. If the module
> exports real-part and imag-part, then those procedures will stop working
> for normal complex numbers for those who import the module. If the
> module does not export them, then those who import the module won't be
> able to use real-part or imag-part on <gcomplex> objects. The last
> patch fixes this.
Thanks for the patches; applied. And thanks for the prompt feedback!
Cheers,
Andy
--
http://wingolog.org/