guile-devel
[Top][All Lists]
Advanced

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

Re: New NUM2INTEGRAL functions - unwanted polymorphism?


From: Michael Livshin
Subject: Re: New NUM2INTEGRAL functions - unwanted polymorphism?
Date: 19 Sep 2001 23:10:01 +0300
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Copyleft)

Mikael Djurfeldt <address@hidden> writes:

> I'm concerned with the last clause of NUM2INTEGRAL:
> 
>   else if (SCM_REALP (num))
>     { /* inexact */
> 
>       double u = SCM_REAL_VALUE (num);
>       ITYPE res = u;
>       if ((double) res == u)
>         return res;
>       else
>         scm_out_of_range (s_caller, num);
>     }
> 
> Do we really want this?

I just copied this mostly verbatim from scm_num2long.  come to think
about it, I don't like it either.

> I'd like to remove that clause.  Comments?

good idea, except I don't know how to deprecate it nicely.  OTOH, you
may argue that it's a bugfix, and so the deprecation machinery
shouldn't be involved at all.

> BTW, personally I would like to have argument type checking and
> conversion completely centralized, just tagging primitives with the
> types and coercions they need.  That way, the entire massage of the
> argument list, checking/dispatching on number of arguments etc could
> be done in one place; GOOPS could eliminate a lot of redundant
> argument checks; and compilers could call primitives directly with
> native types.
> 
> However, maybe that is still a bit futuristic...

oh, it's OK, the idea is discussed here every couple of years. :)

-- 
Experienced C programmers are rearer than they think.
                                         -- Joe Marshall, comp.lang.lisp




reply via email to

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