[comp.lang.eiffel] BITS types

bertrand@eiffel.UUCP (Bertrand Meyer) (10/20/90)

I would be grateful to anyone providing some information about
actual uses of the BITS types (describing bit strings) in Eiffel
applications. Mail to me is fine unless you prefer to post.
-- 
-- Bertrand Meyer
bertrand@eiffel.com

richieb@bony1.uucp (Richard Bielak) (10/23/90)

In article <422@eiffel.UUCP> bertrand@eiffel.UUCP (Bertrand Meyer) writes:
>I would be grateful to anyone providing some information about
>actual uses of the BITS types (describing bit strings) in Eiffel
>applications. Mail to me is fine unless you prefer to post.
>-- 
>-- Bertrand Meyer
>bertrand@eiffel.com

Here is an example of how BITS could be used to create various
bit masks needed for UNIX system services:

class PERMISSIONS 

    feature

        user_r : BITS 32 is 400B; -- that's 400 in Octal

        user_w : BITS 32 is 200B; 

    .... and so on ...

Then later one could combine these to form various bit masks:


     user_rw := user_r or user_w;



I think the need for this kind of support in Eiffel is clear. It's
real ugly to drop into "C" to set up simple bit masks.


Of course, if UNIX were written in Eiffel...   :-)


...richie

        

-- 
+----------------------------------------------------------------------------+
|| Richie Bielak  (212)-815-3072      |  If a thousand people say a foolish  |
|| USENET:        richieb@bony.com    |  thing, it's still a foolish thing.  |
+----------------------------------------------------------------------------+