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.<br>
<br>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.<br>
<br><div class="gmail_quote">On Sun, Nov 15, 2009 at 10:07 AM, Jos Koot <span dir="ltr"><<a href="mailto:jos.koot@telefonica.net">jos.koot@telefonica.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Look for bitwise in the PLT docs.<br>
Jos<br>
<br>
----- Original Message ----- From: "Anye Li" <<a href="mailto:li.anye.0@gmail.com" target="_blank">li.anye.0@gmail.com</a>><br>
To: <<a href="mailto:plt-scheme@list.cs.brown.edu" target="_blank">plt-scheme@list.cs.brown.edu</a>><br>
Sent: Saturday, November 14, 2009 11:21 PM<br>
Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask<br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Using the _bitmask type provided by the scheme/foreign module, is<br>
there a simple and efficient way of doing bitwise manipulations, e.g.<br>
turn off a particular set of bits from an existing set of bits?<br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
<br>
</blockquote>
<br>
</blockquote></div><br>