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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b88383a5d9c51aa0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!h28g2000yqd.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Ada-Singleton-Why does it work like this? Date: Thu, 26 Mar 2009 15:00:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <5a7a870c-40e2-4803-8753-0f9cfd2b800f@k2g2000yql.googlegroups.com> <6d2b2c67-22fb-4283-87ab-58357e47d5ca@v39g2000yqm.googlegroups.com> <18883tufqaunz.gf51zy6m6gna$.dlg@40tude.net> NNTP-Posting-Host: 83.77.208.34 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1238104852 15187 127.0.0.1 (26 Mar 2009 22:00:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 26 Mar 2009 22:00:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h28g2000yqd.googlegroups.com; posting-host=83.77.208.34; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:4351 Date: 2009-03-26T15:00:52-07:00 List-Id: On 26 Mar, 15:28, "Dmitry A. Kazakov" wrote: > > Can you defend the idea that creation does not belong to the type? > > I think I can. Creation cannot be expressed in terms of values of the type. [...] Makes sense. What about... constructors? I mean the real ones. In other mainstream languages (you know, those with curly braces ;-) ) and let's say in Ada 2015 as well, constructors are defined *syntactically* within the type. If we consider the object creation as something that does not belong to the type, then can we say that having constructors in a type definition is just a convenient distortion and not a clear expression of the *semantic* reality, where constructor should be defined as the entity that is external to the type? Something like: class X { public: void doThis(); void doThat(); private: // ... }; // imaginary constructor of type X X() { // make up the state of new object } What is "inside" or "outside" might have no sense in Ada, but in Ada terms the problem can be expressed as whether constructors should be primitive operations of the given type. Just thinking aloud. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada