Hello,
I'm sure this is a very basic question about passing "or-able" flags to
a function. In C I might do something like:
#define FLAG_FOO 1
#define FLAG_BAR 2
#define FLAG_BAZ 4
....
myfn(int flags)
{
if (flags & FLAG_BAR)
printf ("bar flag is set\n");
...
}
and then call myfn with things like
myfn(FLAG_FOO | FLAG_BAZ);
now suppose I want to wrap up myfn and make it available from scheme.
What is the normal scheme way for passing in flags to a function?
I can do something like
SCM scm_myfn(SCM flags)
{
myfn (scm_num2int (flags, SCM_ARG1, "myfn"));
return SCM_BOOLEAN_T;
}
but I'm not sure of the best way to define the flags in scheme. Or
maybe this is not "the scheme way".
Thanks for any suggestions.
-Dan
_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user