unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* function registered with scm_c_define_gsubr: how can i handle an optional parameter?
@ 2017-12-13 21:50 Pierre LINDENBAUM
  2017-12-14 10:19 ` Alex Vong
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre LINDENBAUM @ 2017-12-13 21:50 UTC (permalink / raw)
  To: guile-user

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 !



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-15 16:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-13 21:50 function registered with scm_c_define_gsubr: how can i handle an optional parameter? Pierre LINDENBAUM
2017-12-14 10:19 ` 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

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