comp.lang.ada
 help / color / mirror / Atom feed
* Re: ARG Urgent Problems (was: labeling)
@ 2002-03-19 13:36 Christoph Grein
  2002-03-20 12:19 ` Jean-Pierre Rosen
  0 siblings, 1 reply; 9+ messages in thread
From: Christoph Grein @ 2002-03-19 13:36 UTC (permalink / raw)


From: Jean-Pierre Rosen <rosen@adalog.fr>
> "Tarjei T. Jensen" <tarjei.jensen@kvaerner.com> a écrit dans le message news: 
a7700l$84f4@news.kvaerner.com...
> > C allows both integers and unsigned to wrap, but somehow those who decides
> > these things think that therefore Ada unsigned above integer'last must wrap
> > as well.
> >
> Maybe it's just that you missed an important feature of Ada: don't use 
predefined types, specify your needs, then declare the
> appropriate types. You want a 32 bits integer without wrapping semantics? 
Fine, just declare:
> 
> type My_Int is range 0..2**32-1;
> 
> Your point is that there is no *predefined* type for this; in other languages 
you must rely on predefined types because it is all
> you have - not in Ada.

The only problem being that your compiler might reject to compile this because 
it cannot fulfil the request. My_Int'Base will necessarily be a _signed_integer_ 
at least big enough to hold the specified range, will thus need at least 33 
bits, most probably a 64 bit 
type.



^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: ARG Urgent Problems (was: labeling)
@ 2002-03-20 14:07 Christoph Grein
  0 siblings, 0 replies; 9+ messages in thread
From: Christoph Grein @ 2002-03-20 14:07 UTC (permalink / raw)


>The only problem being that your compiler might reject to compile this because
>>it cannot fulfil the request. My_Int'Base will necessarily be a 
>_signed_integer_
>>at least big enough to hold the specified range, will thus need at least 33
>>bits, most probably a 64 bit
>>type.
>True, but there is no requirement that T'Base occupies the same number of bits 
       ~~~
       The "but" is unnecessary here, you repeat in other words what I wanted to 
       say. If there is no such type on your machine, the compiler will reject
       the declaration. Gnat provides a 64 bit type, as you've tried:
>as T.
>I just tried the following with Gnat:
>    type Int32 is range 0..2**32-1;
>    for Int32'size use 32;
>    I : Int32;
>    B: Int32'Base;
>begin
>   Put_Line (Integer'image (I'size));
>   Put_Line (Integer'Image (B'size));
>
>And it prints:
>32
>64



^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: labeling (was: partitioning (was: Future))
@ 2002-03-15  8:20 Christoph Grein
  2002-03-15 11:59 ` ARG Urgent Problems (was: labeling) Larry Kilgallen
  0 siblings, 1 reply; 9+ messages in thread
From: Christoph Grein @ 2002-03-15  8:20 UTC (permalink / raw)


This is getting more and more absurd. Why not stick to the current syntax:

[statement_identifier:] xxx
  ...
end xxx [identifier];

where xxx stands for:
  Ada95: loop_statement, block_statement
  Ada0Y: case_statement, if_statement, select_statement

Why on earth introduce new syntax? Please get the RM and see how it solves the 
present cases, and then try to take the syntax over to new cases. If you really 
want to have a chance of getting this thru, this is the way to go.

The ARG really has enough urgent problems to solve, and I bey they are reluctant 
to handle any such weird proposals.

> I would prefer
> 
>    case Animal label animal is
> 
> 
>    ......
> 
>     end animal;
> 
>     if Animal in Mammal label animal_if
>     then
> 
>     ...
>     end animal_if;
> 
> or possibly more readable:
> 
>     label animal_if
>     if Animal in Mammal
>     then
>     ...
>     end animal_if;
> 
> Prepending the statement which one want a named end for is perhaps easier to
> accomodate?
> 
> The label would not be available for anything else but end verification, so
> it would not be a problem that it has the same name as a variable or type.
> In other words; labels would have their own name space.
> 
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-03-20 14:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-19 13:36 ARG Urgent Problems (was: labeling) Christoph Grein
2002-03-20 12:19 ` Jean-Pierre Rosen
  -- strict thread matches above, loose matches on Subject: below --
2002-03-20 14:07 Christoph Grein
2002-03-15  8:20 labeling (was: partitioning (was: Future)) Christoph Grein
2002-03-15 11:59 ` ARG Urgent Problems (was: labeling) Larry Kilgallen
2002-03-17 12:59   ` Tarjei T. Jensen
2002-03-17 13:11     ` Nick Williams
2002-03-19  9:22       ` Tarjei T. Jensen
2002-03-19 12:21         ` Jean-Pierre Rosen
2002-03-19 14:38           ` Tarjei T. Jensen

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