bug-guile
[Top][All Lists]
Advanced

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

Re: Can not work with libguile-2.0


From: Mark Harig
Subject: Re: Can not work with libguile-2.0
Date: Thu, 17 Feb 2011 13:23:24 -0500

And in section 2.4(Writing Guile Extensions)
There are some deprecated functions in the example

Agreed.  The example code uses deprecated functions.  It would better
if the developers of Guile were to provide some idiomatic code that
shows the best practice that they recommend programmers use.

Here is the C code in the reference manual:

    #include <math.h>
    #include <libguile.h>

    SCM
    j0_wrapper (SCM x)
    {
      return scm_make_real (j0 (scm_num2dbl (x, "j0")));
    }

    void
    init_bessel ()
    {
      scm_c_define_gsubr ("j0", 1, 0, 0, j0_wrapper);
    }

scm_make_real and scm_num2dbl are included in deprecated.h:

SCM_DEPRECATED SCM scm_make_real (double x);
SCM_DEPRECATED double scm_num2dbl (SCM a, const char * why);

The fact that these functions are marked as deprecated is saying that
Guile recommends that they no longer be used, so it is contradictory
for the manual to include them in example code.

--



reply via email to

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