TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Jean-Pierre Rosen <[log in to unmask]>
Tue, 8 Jul 2003 11:05:54 +0200
text/plain (14 lines)
>11..10 and 1..0 are both null slices (i.e. statically known to be empty).
Your code therefore assigns a null slice >to a null slice and no
out-of-bounds array accesses occur so no error occurs.
>I would hope that a(10..11) := b(0..1); would raise a rich crop of
constraint errors.

No. A null slice never raises Constraint_Error (4.1.2(7)).
Is it a good thing? I can see pros and cons for both...
Anyway, that's the way it is.
           J-P. Rosen ([log in to unmask])
Visit Adalog's web site at