guile-user
[Top][All Lists]
Advanced

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

Re: passing flags to a function


From: Clinton Ebadi
Subject: Re: passing flags to a function
Date: Tue, 02 May 2006 12:14:58 -0400

On Tue, 2006-05-02 at 08:25 -0400, Dan McMahill wrote:
> 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:
...snip...

You can make the flags available to scheme as numbers, and then the
Scheme users can use Guile's bitwise operations (logand, longior,
logxor, etc. [see Simple Data Types -> Numbers -> Bitwise Operations in
the manual]).

> but I'm not sure of the best way to define the flags in scheme.  Or 
> maybe this is not "the scheme way".

This isn't really the Scheme way, but it works if you want to get
bindings done quickly. Ludovic already recommended the more schemey way,
but this isn't such a bad thing for an extension to a C program.

-- 
http://unknownlamer.org
AIM:unknownlamer IRC:address@hidden Jabber:address@hidden
I use Free Software because I value freedom over features.
443E 4F1A E213 7C54 A306  E328 7601 A1F0 F403 574B

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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