comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Static assertions
Date: Sat, 19 May 2001 22:53:56 GMT
Date: 2001-05-19T22:53:56+00:00	[thread overview]
Message-ID: <wccitixt0fv.fsf@world.std.com> (raw)
In-Reply-To: 3B05A63C.25F6B80C@boeing.com

Jeffrey Carter <jeffrey.carter@boeing.com> writes:

> I see. Assert_1 cannot be a dead variable, since it is a constant, but
> it will probably never be referenced. I guess it's a "dead constant".

Yeah.  Or "dead object".

> It would appear that
> 
>    Assert_1 : constant Assert := Assert'(Integer'Size = 73);
> 
> must cause a compilation error, since Assert is a static subtype, so the
> qualified expression is static, and a static qualified expression must
> be evaluated at compile time.

I agree.

> I'm just trying to come up with something a little shorter and less
> obscure than using Boolean'Pos.

A worthy goal.  I wish that "Assert(Integer'Size = 73)" would work.
Alas.

- Bob



  reply	other threads:[~2001-05-19 22:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-18  5:34 Static assertions Christoph Grein
2001-05-18 13:38 ` Robert A Duff
2001-05-18 16:15   ` Jeffrey Carter
2001-05-18 17:25     ` Ted Dennison
2001-05-18 21:27     ` Robert A Duff
2001-05-18 22:46       ` Jeffrey Carter
2001-05-19 22:53         ` Robert A Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-05-17 15:07 Jean-Pierre Rosen
2001-05-17 17:44 ` Jeffrey Carter
2001-05-17 19:09   ` Marin David Condic
2001-05-17 22:34     ` Jeffrey Carter
2001-05-18 13:39       ` Marin David Condic
2001-05-18  1:23 ` Robert A Duff
2001-05-19  7:40 ` David Kristola
2001-05-19 22:56   ` Robert A Duff
2001-05-19  8:36 ` Aaro Koskinen
2001-05-21  7:50   ` Jean-Pierre Rosen
2001-06-12  3:59     ` David Thompson
replies disabled

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