[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: passing flags to a function
From: |
Kevin Ryde |
Subject: |
Re: passing flags to a function |
Date: |
Wed, 03 May 2006 11:43:20 +1000 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Dan McMahill <address@hidden> writes:
>
> SCM scm_myfn(SCM flags)
> {
> myfn (scm_num2int (flags, SCM_ARG1, "myfn"));
Various things in the guile core are done like that, stuff like O_RDWR
for `open'. The list of symbols Ludovic described is done in the
guile-gtk interface and works nicely too.
If you're entirely in scheme then the ice-9 optargs module to take
keywords is good, especially if you want actual values, not just
yes/no flags.
(foo #:error-check #t
#:verbose #f
...)