From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,31465939d9bd22cc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!d39g2000yqa.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Question about default discriminants and mutable objects. Date: Thu, 6 May 2010 07:59:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: <04d5b07b-7a14-44c4-ab14-7f3a1b110d3f@d39g2000yqa.googlegroups.com> References: <4be20f28$0$2431$4d3efbfe@news.sover.net> <866a9a72-1f76-480d-b860-57e66ae155c0@d39g2000yqa.googlegroups.com> <62cb6d15-8436-45d8-978c-3bd98254387d@q30g2000yqd.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1273157967 8672 127.0.0.1 (6 May 2010 14:59:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 6 May 2010 14:59:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d39g2000yqa.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11326 Date: 2010-05-06T07:59:26-07:00 List-Id: On May 5, 9:56=A0pm, AdaMagica wrote: > Gene, > you guessed quite well. See Ada 83 Rationale > > http://archive.adaic.com/standards/83rat/html/ratl-04-07.html#4.7 > > and especially 4.7.4. I don't think that's a complete explanation, though. It doesn't explain why you couldn't have (1) a discriminant type without a default, in which the initial value of the discriminant must be specified for each object but the discriminant could still be changed by assigning the whole object; or (2) a discriminant type with a default discriminant but where all objects of the type are still constrained [thus making an object declaration X : T; equivalent to X : T(default);]. It's probably the inability to do one or both of those two things that causes the "annoyance" Randy mentioned. As for why those possibilities couldn't be provided, it's probably just because they would have had to come up with some funky syntax for it. That's not a trivial consideration. Designing syntax is not always easy. -- Adam