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: 103376,1a52c822fc0dbb23 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!n35g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Rational for not making cursor tagged in Containers Date: 24 Apr 2007 09:27:37 -0700 Organization: http://groups.google.com Message-ID: <1177432057.705889.229690@n35g2000prd.googlegroups.com> References: <1176998738.656903.141250@q75g2000hsh.googlegroups.com> <1177010938.200523.325290@p77g2000hsh.googlegroups.com> <1a8y2vakorfhx.225uqh4hifpd$.dlg@40tude.net> <1xmzi7newnilp.23m3zze8h9yi.dlg@40tude.net> <1177066583.5876.30.camel@localhost.localdomain> <1177080147.5876.87.camel@localhost.localdomain> <1q1kx2jlcvnuj.ck0711mj4few$.dlg@40tude.net> <1177097829.26685.36.camel@localhost.localdomain> <95wmj9goo6wc$.13f1j4dnadwws$.dlg@40tude.net> <1177349886.343834.295210@q75g2000hsh.googlegroups.com> <1177373706.552914.71270@q75g2000hsh.googlegroups.com> <1ccueevyp8oba.11c8wwyujtw1o$.dlg@40tude.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1177432070 13372 127.0.0.1 (24 Apr 2007 16:27:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Apr 2007 16:27:50 +0000 (UTC) In-Reply-To: <1ccueevyp8oba.11c8wwyujtw1o$.dlg@40tude.net> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: n35g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news1.google.com comp.lang.ada:15259 Date: 2007-04-24T09:27:37-07:00 List-Id: On Apr 24, 3:43 am, "Dmitry A. Kazakov" wrote: > >>> X, Y : GUI_Boolean; > > >>> If you say X = Y, does it compare just the values, or does it compare > >>> the discriminants also? > > >> That depends on how equality operation were defined for the given type. In > >> the concrete case of GUI_Boolean, the user-defined "=" would raise > >> Constraint_Error if at least one of the discriminants is false. > > > OK, I've got it. > > > function "=" (X, Y : GUI_Boolean) return Boolean is > > begin > > if not X.Defined or else not Y.Defined then > > raise Constraint_Error; > > else > > return X = Y; > > end if; > > end "="; > > > Is that how you thought this user-defined "=" would be written? > > Yup, the predefined "=" should be renamed first. So a user-defined "=" that causes a stack overflow due to infinite recursion doesn't bother you? You still don't see the issue, do you? > > I think you've missed the point. If you want a feature like this in > > the language, you can't base the whole semantics on one particular > > example you happened to come up with (or that you happened to run > > across a use for when you were working on some particular project). > > The design of the feature in the language has to be more general than > > that, and it has to include cases where a discriminant has some > > meaning other than "This value is defined". > > I don't see any problems with generation of a predefined "=" and literals > (True, False). [True is a literal of the type GUI_Boolean, with all > consequences of that.] If True has type GUI_Boolean, then it must have a "Defined" discriminant. What is True.Defined? How does the programmer indicate what it would be? (And if you say that True.Defined is "true" because "true" is a defined value, then you still don't get it---the Ada language isn't going to know that, and you're going to need a way to tell it that.) > > and as one of my examples hinted at, I don't think the > > current language syntax is enough to handle this without some pretty > > major surgery. > > I don't see any problem with that. Sure you don't, because you're not the one who'd have to do the surgery. -- Adam