<HTML><BODY>At file:///usr/share/doc/racket/foreign/Enumerations_and_Masks.html?q=_enum#%28def._%28%28lib._ffi%2Funsafe..rkt%29.__enum%29%29<br><br><table class="boxed RBoxed mceItemTable" style="width: 559px; background-color: rgb(232, 232, 255); white-space: nowrap; color: rgb(0, 0, 0); font-family: serif; text-align: left; position: relative; z-index: 0; " cellspacing="0" data-mce-style="width: 559px; background-color: #e8e8ff; white-space: nowrap; color: #000000; font-family: serif; text-align: left; position: relative; z-index: 0;"><tbody><tr><td style="padding-left: 0px; padding-right: 0px; " data-mce-style="padding-left: 0px; padding-right: 0px;"><blockquote class="SubFlow" style="margin-left: 0em; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; " data-mce-style="margin: 0em;"><div class="RBackgroundLabel SIEHidden" style="float: right; width: 0px; height: 0px; " data-mce-style="float: right; width: 0px; height: 0px;"><div class="RBackgroundLabelInner" style="font-family: sans-serif; position: relative; width: 25em; left: -25.5em; top: 0px; text-align: right; color: white; z-index: 0; font-weight: bold; " data-mce-style="font-family: sans-serif; position: relative; width: 25em; left: -25.5em; top: 0px; text-align: right; color: white; z-index: 0; font-weight: bold;"><p style="margin-bottom: 0px; " data-mce-style="margin-bottom: 0px;">procedure</p></div></div><p class="RForeground" style="margin-bottom: 0px; position: relative; left: 0px; top: 0px; z-index: 1; " data-mce-style="margin-bottom: 0px; position: relative; left: 0px; top: 0px; z-index: 1;"><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); " data-mce-style="font-family: monospace; white-space: inherit; color: #843c24;">(</span><a name="(def._((lib._ffi/unsafe..rkt).__bitmask))" class="mceItemAnchor"></a><span title="Provided from: ffi/unsafe"><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); " data-mce-style="font-family: monospace; white-space: inherit; color: #262680;"><a class="RktValLink" style="text-decoration: none; color: blue; " href="file:///usr/share/doc/racket/foreign/Enumerations_and_Masks.html?q=_enum#%28def._%28%28lib._ffi%2Funsafe..rkt%29.__bitmask%29%29" data-pltdoc="x" data-mce-href="file:///usr/share/doc/racket/foreign/Enumerations_and_Masks.html?q=_enum#%28def._%28%28lib._ffi%2Funsafe..rkt%29.__bitmask%29%29" data-mce-style="text-decoration: none; color: blue;">_bitmask</a></span></span><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span><span class="RktVar" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); font-style: italic; " data-mce-style="font-family: monospace; white-space: inherit; color: #262680; font-style: italic;">symbols</span><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span>[<span class="RktVar" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); font-style: italic; " data-mce-style="font-family: monospace; white-space: inherit; color: #262680; font-style: italic;">basetype</span>]<span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); " data-mce-style="font-family: monospace; white-space: inherit; color: #843c24;">)</span><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span>→<span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); " data-mce-style="font-family: monospace; white-space: inherit; color: #262680;"><a class="RktValLink" style="text-decoration: none; color: blue; " href="file:///usr/share/doc/racket/foreign/ctype.html?q=_enum#%28def._%28%28quote._~23~25foreign%29._ctype~3f%29%29" data-pltdoc="x" data-mce-href="file:///usr/share/doc/racket/foreign/ctype.html?q=_enum#%28def._%28%28quote._~23~25foreign%29._ctype~3f%29%29" data-mce-style="text-decoration: none; color: blue;">ctype?</a></span></p></blockquote></td></tr><tr><td style="padding-left: 0px; padding-right: 0px; " data-mce-style="padding-left: 0px; padding-right: 0px;"><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span><span class="RktVar" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); font-style: italic; " data-mce-style="font-family: monospace; white-space: inherit; color: #262680; font-style: italic;">symbols</span><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span>:<span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); " data-mce-style="font-family: monospace; white-space: inherit; color: #843c24;">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); " data-mce-style="font-family: monospace; white-space: inherit; color: #262680;"><a class="RktStxLink" style="text-decoration: none; color: black; " href="file:///usr/share/doc/racket/reference/if.html?q=_enum#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" data-pltdoc="x" data-mce-href="file:///usr/share/doc/racket/reference/if.html?q=_enum#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" data-mce-style="text-decoration: none; color: black;">or</a></span><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); " data-mce-style="font-family: monospace; white-space: inherit; color: #262680;"><a class="RktValLink" style="text-decoration: none; color: blue; " href="file:///usr/share/doc/racket/reference/symbols.html?q=_enum#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" data-pltdoc="x" data-mce-href="file:///usr/share/doc/racket/reference/symbols.html?q=_enum#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" data-mce-style="text-decoration: none; color: blue;">symbol?</a></span><span class="hspace" style="font-family: monospace; " data-mce-style="font-family: monospace;"> </span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); " data-mce-style="font-family: monospace; white-space: inherit; color: #262680;"><a class="RktValLink" style="text-decoration: none; color: blue; " href="file:///usr/share/doc/racket/reference/pairs.html?q=_enum#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" data-pltdoc="x" data-mce-href="file:///usr/share/doc/racket/reference/pairs.html?q=_enum#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" data-mce-style="text-decoration: none; color: blue;">list?</a></span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); " data-mce-style="font-family: monospace; white-space: inherit; color: #843c24;">)</span></td></tr></tbody></table> <br>Trying:<br><br>> (_bitmask '(a b))<div>_bitmask: bad spec in '(a b)</div><br>> (_bitmask 'a)<div>cdr: contract violation</div><div> expected: pair?</div><div> given: 'a</div><br>Works just fine:<br><br> > (cast 5 _int (_bitmask '((a 1) (b 2))))<div>'(a)<br> </div><div>> (cast 5 _int (_bitmask '(a = 1 b = 2)))</div><div>'(a)</div><div><br>So there is an error either in documentation or in ffi/unsafe. I expected (_bitmask '(a b c)) to be treated as (_bitmask '(a = 1 b = 2 c = 4)) and so on.<br><br>Plese, fix either docs, or module. <br><br>I have Racket 5.3.4 @ Debian testing.<br><br>monk@veles:~$ dpkg -s racket</div><div>Package: racket</div><div>Status: install ok installed</div><div>Priority: optional</div><div>Section: lisp</div><div>Installed-Size: 9913</div><div>Maintainer: David Bremner <bremner@debian.org></div><div>Architecture: i386</div><div>Version: 5.3.4+r2+dfsg1-2</div><div><br></div></BODY></HTML>