unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark Harig <idirectscm@aim.com>
To: lispor@163.com, bug-guile@gnu.org
Subject: Re: Can not work with libguile-2.0
Date: Thu, 17 Feb 2011 13:23:24 -0500	[thread overview]
Message-ID: <8CD9CE6E0B29934-235C-1DA91@Webmail-m118.sysops.aol.com> (raw)
In-Reply-To: <1e640654.925f.12e338022b5.Coremail.lispor@163.com>

> 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.

--



  parent reply	other threads:[~2011-02-17 18:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 12:02 Can not work with libguile-2.0 Fu-Gangqiang
2011-02-17 13:02 ` Hans Aberg
2011-02-17 13:40 ` Fu-Gangqiang
2011-02-17 18:04 ` Mark Harig
2011-02-17 18:23 ` Mark Harig [this message]
2011-02-18  8:41   ` Andy Wingo
2011-02-17 19:08 ` Mark Harig
2011-02-18  8:53   ` Andy Wingo
2011-02-18 19:42     ` Mark Harig
2011-02-20 10:13       ` Andy Wingo
2011-02-18  1:39 ` Fu-Gangqiang
2011-02-18  8:34 ` Andy Wingo
2011-02-19 15:30   ` linking with libguile-2.0, rpath Bruno Haible
2011-02-20 10:58     ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8CD9CE6E0B29934-235C-1DA91@Webmail-m118.sysops.aol.com \
    --to=idirectscm@aim.com \
    --cc=bug-guile@gnu.org \
    --cc=lispor@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).