comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Ann: UnZip-Ada v.20
Date: Mon, 19 Mar 2007 14:19:53 +0100
Date: 2007-03-19T14:19:53+01:00	[thread overview]
Message-ID: <45fe8dfa$1@news.post.ch> (raw)
In-Reply-To: <yge8xdt5r4r.fsf@hugsarin.dmusyd.edu>

Jacob Sparre Andersen schrieb:
> Harald Korneliussen found the code:
> 
>>   -- Codes for methods
>>
>>   stored:    constant:= 0;
>>   shrunk:    constant:= 1;
>>   reduced_1: constant:= 2;
>>   reduced_2: constant:= 3;
>>   reduced_3: constant:= 4;
>>   reduced_4: constant:= 5;
>>   imploded:  constant:= 6;
>>   deflated:  constant:= 8;
>>
>>   SupportedMethods: constant:=
>>     2 ** stored    + 2 ** shrunk    +
>>     2 ** reduced_1 + 2 ** reduced_2 +
>>     2 ** reduced_3 + 2 ** reduced_4 +
>>     2 ** imploded  +
>>     2 ** deflated;
> 
> Looks like something I might write:
> 
>    type Method_Codes (Stored,
>                       Shrunk,
>                       reduced_1,
>                       reduced_2,
>                       reduced_3,
>                       reduced_4,
>                       imploded,
>                       deflated);

for Method_Codes use (
     Stored:    => 0,
     Shrunk:    => 1,
     Reduced_1: => 2,
     Reduced_2: => 3,
     Reduced_3: => 4,
     Reduced_4: => 5,
     Imploded:  => 6,
     Deflated:  => 8);

>    type Method_Support is array (Method_Codes) of Boolean;
>    pragma Pack (Method_Support);
> 
>    Supported_Methods : constant Method_Support := (others => True);
> 
> Any reason not to do it like this?

Can't think of any.

Martin



  reply	other threads:[~2007-03-19 13:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 13:14 Ann: UnZip-Ada v.20 Gautier
2007-03-16 15:54 ` Poul-Erik Andreasen
2007-03-16 16:03   ` Jacob Sparre Andersen
2007-03-16 16:24     ` Poul-Erik Andreasen
2007-03-16 17:29   ` Gautier
2007-03-16 19:28     ` Poul-Erik Andreasen
2007-03-16 21:36     ` Jacob Sparre Andersen
2007-03-17  7:52       ` Gautier
2007-03-19 11:30         ` Harald Korneliussen
2007-03-19 12:56           ` Jacob Sparre Andersen
2007-03-19 13:19             ` Martin Krischik [this message]
2007-03-19 13:46               ` Georg Bauhaus
2007-03-19 16:29                 ` Georg Bauhaus
2007-03-19 14:05           ` gautier_niouzes
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox