chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] <inexact> and <exact>


From: Alex Shinn
Subject: Re: [Chicken-users] <inexact> and <exact>
Date: Tue, 10 Aug 2004 20:38:54 -0500
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Tue, 10 Aug 2004 17:40:24 -0400 (EDT), Daniel B. Faken wrote:
> 
>   I am working with a C++ library which has methods that take a 'double'.
>   Using declare(full_specialization, yes) I can get TinyCLOS to recognize 
> method calls when the parameter is of the form 1.0001, but not if it is 
> just '1' - I get an error looking for an <exact> method.
>   This seems supported by R5RS saying that exactly one of exact? and
> inexact? is true, but how can I get my methods to recognized exact numbers 
> as well?  (I don't really want to define an <exact> case for each one..)
> 
>   I'm using today's CVS version (thanks for implementing ref's!), and the 
> docs say that <exact> and <inexact> are disjoint subclasses of <number>.

How about using <number>?

(define-method (add (x <number>) (y <number>))
  (+ x y))

-- 
Alex




reply via email to

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