guile-devel
[Top][All Lists]
Advanced

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

scm_integer_p and scm_num2int mismatch


From: Jan Nieuwenhuizen
Subject: scm_integer_p and scm_num2int mismatch
Date: 07 Oct 2001 21:38:11 +0200

Hi,

In latest guile cvs, I've got a problem checking for the type of a SCM
symbol, and converting it to a C int.

The behaviour of scm_num2int has changed, it now only wants an integer
value as input, but the behaviour of scm_integer_p has not changed, so
this no longer can serve as a test for valdid scm_num2int values.

Is this intentional, ie, should

  if (scm_integer_p (s) == SCM_BOOL_T)
    printf ("%d\n", gh_num2int (s));

be changed to:

  if (scm_integer_p (s) == SCM_BOOL_T)
    {
      if (scm_exact_p (s) == SCM_BOOL_F)
        printf ("%d\n", gh_num2int (s));
      else
        printf ("%d\n", gh_num2int (scm_inexact_to_exact (s)));
    }

or will scm_integer_p be changed too, rsn?

Greetings,
Jan.

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




reply via email to

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