TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Jean-Pierre Rosen <[log in to unmask]>
Reply To:
Jean-Pierre Rosen <[log in to unmask]>
Date:
Mon, 6 Jun 2005 10:12:10 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (23 lines)
Chris Sparks a écrit :
> The problem is that I rarely use discriminants.  It just seems silly to 
> me that given that there are initializers on the type definition below, 
> the compiler can deduce what the other value is for MR2 and MR3.  Now if 
> I didn't have initializers then that be a whole different matter.
> 
Default value in discriminants are not really "default values" in the 
usual sense. Actually, it all happens the other way round. Let me explain:

1) A discriminant must be initialized.
2) But it is (sometimes) necessary to declare unconstrained variables
3) => Unconstrained variables are allowed only if all discriminants have 
default values.

In a sense, discriminant default values give the values of discriminants 
for *unconstrained variables*. They are not used in the declaration of 
*constrained* variables.

-- 
---------------------------------------------------------
            J-P. Rosen ([log in to unmask])
Visit Adalog's web site at http://www.adalog.fr

ATOM RSS1 RSS2