comp.lang.ada
 help / color / mirror / Atom feed
* ARG Urgent Problems (was: labeling)
  2002-03-15  8:20 labeling (was: partitioning (was: Future)) Christoph Grein
@ 2002-03-15 11:59 ` Larry Kilgallen
  2002-03-17 12:59   ` Tarjei T. Jensen
  0 siblings, 1 reply; 9+ messages in thread
From: Larry Kilgallen @ 2002-03-15 11:59 UTC (permalink / raw)


In article <mailman.1016180522.31471.comp.lang.ada@ada.eu.org>, Christoph Grein <christoph.grein@eurocopter.com> writes:

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

Out of curiosity, what are some of the "urgent problems" ?



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

* Re: ARG Urgent Problems (was: labeling)
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Tarjei T. Jensen @ 2002-03-17 12:59 UTC (permalink / raw)


Larry Kilgallen wrote:
> Christoph Grein writes:
>
> > The ARG really has enough urgent problems to solve, and I bey they are
> > reluctant to handle any such weird proposals.
>
> Out of curiosity, what are some of the "urgent problems" ?

They could get us unsigned integers and not just the positive part of
integers. By unsigned I mean unsigned with runtime checking.

Quoting C unsigned as a reason for not having real unsigned is pretty bogus
because C integers seems to wrap very well.

We don't want to abandon runtime checks on integers just because C does not
do any checking.

greetings,






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

* Re: ARG Urgent Problems (was: labeling)
  2002-03-17 12:59   ` Tarjei T. Jensen
@ 2002-03-17 13:11     ` Nick Williams
  2002-03-19  9:22       ` Tarjei T. Jensen
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Williams @ 2002-03-17 13:11 UTC (permalink / raw)


What exactly do you mean by 'unsigned integers and not just the positive
part of integers'?

If you want to model unsigned integers the same way that C models them, then
use modular types, surely?

Nick.

"Tarjei T. Jensen" <tarjei.jensen@kvaerner.com> wrote in message
news:a7240i$rh416@news.kvaerner.com...
> Larry Kilgallen wrote:
> > Christoph Grein writes:
> >
> > > The ARG really has enough urgent problems to solve, and I bey they are
> > > reluctant to handle any such weird proposals.
> >
> > Out of curiosity, what are some of the "urgent problems" ?
>
> They could get us unsigned integers and not just the positive part of
> integers. By unsigned I mean unsigned with runtime checking.
>
> Quoting C unsigned as a reason for not having real unsigned is pretty
bogus
> because C integers seems to wrap very well.
>
> We don't want to abandon runtime checks on integers just because C does
not
> do any checking.






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

* Re: ARG Urgent Problems (was: labeling)
  2002-03-17 13:11     ` Nick Williams
@ 2002-03-19  9:22       ` Tarjei T. Jensen
  2002-03-19 12:21         ` Jean-Pierre Rosen
  0 siblings, 1 reply; 9+ messages in thread
From: Tarjei T. Jensen @ 2002-03-19  9:22 UTC (permalink / raw)



"Nick Williams" <nickw@acm.org> wrote in message
news:1016370675.163940@ananke.eclipse.net.uk...
> What exactly do you mean by 'unsigned integers and not just the positive
> part of integers'?

Unsigned in Ada (Natural) is from 0 to integer'last which is the same as
system.max_int;

> If you want to model unsigned integers the same way that C models them,
then
> use modular types, surely?

I just said that this is not what I want. I want a real unsigned with
rangechecking and the lot  - and not the abominable modular type workaround.

It really should be possible to map the C type  size_t to an ada unsigned
type without having to botch the job by using a modular type.

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.

That logic beats me.

greetings,






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

* Re: ARG Urgent Problems (was: labeling)
  2002-03-19  9:22       ` Tarjei T. Jensen
@ 2002-03-19 12:21         ` Jean-Pierre Rosen
  2002-03-19 14:38           ` Tarjei T. Jensen
  0 siblings, 1 reply; 9+ messages in thread
From: Jean-Pierre Rosen @ 2002-03-19 12:21 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]


"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.

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





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

* 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-19 12:21         ` Jean-Pierre Rosen
@ 2002-03-19 14:38           ` Tarjei T. Jensen
  0 siblings, 0 replies; 9+ messages in thread
From: Tarjei T. Jensen @ 2002-03-19 14:38 UTC (permalink / raw)



"Jean-Pierre Rosen" wrote
>
> "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;

Try
type My_int is range 0 .. 2**64-1;

Even on 32bit unix there are the occational 64bit unsigned integer these
days.


greetings,







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

* Re: ARG Urgent Problems (was: labeling)
  2002-03-19 13:36 Christoph Grein
@ 2002-03-20 12:19 ` Jean-Pierre Rosen
  0 siblings, 0 replies; 9+ messages in thread
From: Jean-Pierre Rosen @ 2002-03-20 12:19 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]


"Christoph Grein" <christoph.grein@eurocopter.com> a �crit dans le message news:
>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 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

(note the use of 'size on objects rather than types - necessary to get the truth about how much memory space is used)

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





^ 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

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-20 14:07 ARG Urgent Problems (was: labeling) Christoph Grein
  -- strict thread matches above, loose matches on Subject: below --
2002-03-19 13:36 Christoph Grein
2002-03-20 12:19 ` Jean-Pierre Rosen
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