guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] New division operators, and optimization for fractions


From: Mark H Weaver
Subject: Re: [PATCH] New division operators, and optimization for fractions
Date: Sun, 13 Feb 2011 09:55:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Andy,

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.

    Best,
     Mark


Attachment: 0001-Added-internal-C-function-to-extract-from-values-obj.patch
Description: Added internal C function to extract from values object

Attachment: 0002-Make-divide-functions-return-values-via-SCM-output-a.patch
Description: Make divide functions return values via (SCM *) output arguments

Attachment: 0003-Optimize-division-operators-handling-of-fractions.patch
Description: Optimize division operators handling of fractions

Attachment: 0004-Add-four-new-sets-of-fast-quotient-and-remainder-ope.patch
Description: Add four new sets of fast quotient and remainder operators

Attachment: 0005-Optimize-truncate-round-floor-and-ceiling.patch
Description: Optimize truncate, round, floor, and ceiling

Attachment: 0006-Reduce-code-size-of-division-operators.patch
Description: Reduce code size of division operators

Attachment: 0007-Slight-optimization-for-scm_equal_p.patch
Description: Slight optimization for scm_equal_p

Attachment: 0008-Make-SCM_NUMP-and-SCM_NUMBERP-more-extensible.patch
Description: Make SCM_NUMP and SCM_NUMBERP more extensible

Attachment: 0009-Allow-GOOPS-getters-to-add-methods-to-primitive-gene.patch
Description: Allow GOOPS getters to add methods to primitive generics


reply via email to

[Prev in Thread] Current Thread [Next in Thread]