unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Pierre LINDENBAUM <Pierre.Lindenbaum@univ-nantes.fr>
To: guile-user@gnu.org
Subject: function registered with scm_c_define_gsubr: how can i handle an optional parameter?
Date: Wed, 13 Dec 2017 22:50:17 +0100	[thread overview]
Message-ID: <caddca02bf50a5514afd592351d01bbe@imap.univ-nantes.prive> (raw)

Hi all,

(cross posted on SO: https://stackoverflow.com/questions/47797521 )


I've defined a guile C function:

     static SCM myfun(SCM arg1,SCM opt_arg2)
       {
       return SCM_BOOL_T;
       }

registered with

     scm_c_define_gsubr ("myfun", 1, 1, 0, myfun);

there is one optional argument. How can I detect if opt_arg2 has been 
used ?

in

     (myfun 1)

or

     (myfun 1 2)


Thanks !



             reply	other threads:[~2017-12-13 21:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 21:50 Pierre LINDENBAUM [this message]
2017-12-14 10:19 ` function registered with scm_c_define_gsubr: how can i handle an optional parameter? Alex Vong
2017-12-14 12:30   ` Mark H Weaver
2017-12-14 13:50     ` Alex Vong
2017-12-15  8:06       ` Mark H Weaver
2017-12-15 16:59         ` Alex Vong

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=caddca02bf50a5514afd592351d01bbe@imap.univ-nantes.prive \
    --to=pierre.lindenbaum@univ-nantes.fr \
    --cc=guile-user@gnu.org \
    /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).