Tue, 13 Jun 2000 03:33:14 -0700, Simon Marlow <[EMAIL PROTECTED]> pisze:
> The POSIX library needs revamping somewhat; but I've been waiting
> for the FFI story to settle down before thinking about this.
Currently FileMode looks similar as in C: nullFileMode, constants
for each bit, {union,intersect}FileModes. Testing a bit looks like
mode `intersectFileModes` ownerReadMode /= nullFileMode,
setting a bit is simple with unionFileModes, and clearing a bit is
crazy: requires enumerating all other bits (no diffFileModes nor
complementFileMode) and thus clearing bits that Posix does not present.
What about an interface that treats it as a kind of a record?
ownerReadMode :: FileMode -> Bool
setOwnerReadMode :: FileMode -> Bool -> FileMode
------------------------------------------------------------------------
I am designing a new record syntax proposal. Looks like a few
constructs that are easily translated into a recordless language
would provide much fun: kind of OOP, overloading of what should be
overloadable, first-class modules and classes, extensible records
(not anonymous).
In particular C structures and bitfields could be syntactically
treated as records, without physical marshalling and unmarshalling
into records.
mode.ownerRead
mode with ownerExec = True; groupExec = True; otherExec = True
mode with owner = Perms True True False
--
__("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
\__/ GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
^^ W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK 5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-