guile-user
[Top][All Lists]
Advanced

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

function registered with scm_c_define_gsubr: how can i handle an optiona


From: Pierre LINDENBAUM
Subject: function registered with scm_c_define_gsubr: how can i handle an optional parameter?
Date: Wed, 13 Dec 2017 22:50:17 +0100
User-agent: Roundcube Webmail/1.1.2

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 via email to

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