[plt-scheme] bitwise operations on scheme/foreign _bitmask
Of course I did that. I know how to do bitwise arithmetic with integers in
Scheme. That's not what I was asking. _bitmask in the foreign module
doesn't give me integers. It gives me lists of symbols. Moreover, I see no
way of converting between the symbols and numbers manually besides doing the
equivalent of defining the bitmask again. So it seems to me, from reading
the documentation, that I have to use list algorithms, which to me seem to
be more work for both me and the computer and less natural than using
arithmetic bitwise operations on numbers.
If that's the case, I see no reason to use _bitmask, other than to get a
nice symbolic representation of a bitmask when a foreign function returns
one. That's less important to me than actually being able to manipulate the
bitmask conveniently and efficiently.
On Sun, Nov 15, 2009 at 10:07 AM, Jos Koot <jos.koot at telefonica.net> wrote:
> Look for bitwise in the PLT docs.
> Jos
>
> ----- Original Message ----- From: "Anye Li" <li.anye.0 at gmail.com>
> To: <plt-scheme at list.cs.brown.edu>
> Sent: Saturday, November 14, 2009 11:21 PM
> Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask
>
>
> Using the _bitmask type provided by the scheme/foreign module, is
>> there a simple and efficient way of doing bitwise manipulations, e.g.
>> turn off a particular set of bits from an existing set of bits?
>> _________________________________________________
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20091115/ea128cc4/attachment.html>