guile-devel
[Top][All Lists]
Advanced

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

Re: scm_num2int change


From: Dirk Herrmann
Subject: Re: scm_num2int change
Date: Sun, 23 Sep 2001 10:31:18 +0200 (MEST)

On Fri, 21 Sep 2001, Bill Schottstaedt wrote:

> > > Where in "num" does it say "exact num"?
> > Where in "num" does it say "integer"? :)

Well, first some words about the 'content layer' of this thread:  I
agree with Bill that scm_num2<foo> should accept _any_ number.  IMO,
rounding should be used to produce an integer, and inexact->exact should
be used to produce an exact result.  The reason why I think so is that the
names scm_num2<foo> don't indicate any restriction with respect to the
type of number they accept.  Thus, it is confusing to get a type error
message when passing a number to scm_num2<foo>.  In other words, as long
as we provide a set of functions scm_num2<foo> or scm_number2<foo>, these
functions should accept any number.  Their behaviour should, however, be
clearly documented, which up to now obviuosly wasn't the case.

Providing additional functions like scm_exact_integer2<foo> or similar is
not a bad idea, however, there is again the question of a sensible subset
for the types that are to be used for <foo>.  In a recent discussion we
found that we need functions that check in advance whether a conversion
will work.  We are now discussing the following set of functions:

SCM scm_<foo>2number (<foo>)
<foo> scm_number2<foo> (SCM)             /* any number */
bool scm_number2<foo>_ext (SCM, <foo>*)  /* maybe a different postfix */
<foo> scm_{exact_}?{integer|rational|whatever}2<foo> (SCM)
bool scm_{exact_}?{integer|rational|whatever}2<foo>_ext (SCM, <foo>*)

and for most of these <foo> could be any of char, uchar, short, ushort,
int, uint, long, ulong, long long, ulong long, size_t, intptr_t, plus all
the C99 types like int32, int64 (sorry, I don't know the exact names).

> I've always suspected the Guile developers don't actually use Guile.
> If its name is num2int the obvious thought it that it's converting
> a scheme integer to a C integer.  If I have a C procedure taking
> SCM args (you really should write one someday), and I ask
> is this an integer, and I get "yes", I should be able to say
> "give me its value as a C integer" and not have to worry about
> whether it's exact (which is an unrelated issue -- it is simply
> a bug in Guile that (exact? 3/4) returns #f).  But, I can tell
> when I'm talking to a brick wall.  How about providing a
> function or macro that returns #t if its arg is handlable by whatever
> is today's version of the scm->C conversion routine -- at this
> point I have a huge pile of macros trying to clean up after
> the mess you're making.

Now some words about the 'emotional layer' of this thread:  I find these
comments highly inadequate.  Up to now we have had an athmosphere of
friendly discussion on this list.  If you follow CVS, you typically
benefit from early bugfixes and new features.  However, you also accept
that there happen changes that you don't like and that may even be undone
later.  If you can't live with that, don't use CVS.  You don't have to.  
That is, if you change large parts of your code due to some CVS changes is
not _our_ problem.  If you would have looked into the CVS manual (you
really should do so someday)  you will find that it is even possible to
check out older repository states - those which don't include the most
recent patches yet which you are unhappy about.

If you feel like talking to a brick wall if your points are not accepted
(or at least not by everyone), this again is not a problem of the people
on this (or any other) list.  Sending a complaint on September, 20th,
getting some responses on the same day and the very next day does not seem
like talking against a brick wall.

In another mail you write:
> you guys apparently even brag that you don't read guile-user

Sorry, but noone ever claimed not to read guile-user.  I receive all these
mails in the same mail folder.  I don't even look to which of the guile
mailing lists the mail originally went to.  Please forgive me that in my
spare time I take the freedom to choose which mails I answer - and that
such an answer may potentially come some days after the question.

> I think this is sick.

Your attitude to demand that others immediately react on a request of
yours is strange.  Do you get paid for your work with guile?  (If you use
guile for some thesis, I'd call this getting paid as well.)  I don't and
many of the other developers don't get paid also (I assume).  I enjoy
working with guile in private projects and I also enjoy improving it and
having others benefit from this.  However, your mail has made me angry.  
If you get paid for your work with guile I suggest you contact a
commercial company or hire people that add the changes that you demand.  
Then, you have a right to demand the fulfillment of your requests.  
However, I still recommend that you select a different tone if talking to
your employees - otherwise you won't keep them for long.  Talking to
people that you don't pay and that provide you with a free service in this
tone is something which I will not accept.

Best regards
Dirk Herrmann




reply via email to

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