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,dbbbb21ed7f581b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 01 Dec 2009 13:13:29 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Operation can be dispatching in only one type References: <025105f2-5571-400e-a66f-ef1c3dc9ef32@g27g2000yqn.googlegroups.com> <1wtsriaxu0s4s$.ikwnnz5teukp$.dlg@40tude.net> <1iipp3bn16fe2.yqa1gz1ru17a$.dlg@40tude.net> <18wh86jvjvoe0.cofxcc8udm6q$.dlg@40tude.net> <53a35ed9-88ac-43dc-b2a2-8d6880802328@j19g2000yqk.googlegroups.com> <4b091fb9$0$6567$9b4e6d93@newsspool4.arcor-online.net> <1w0q3zxzw79pt$.5z0juiky7kfd$.dlg@40tude.net> <0f177771-381e-493b-92bb-28419dfbe4e6@k19g2000yqc.googlegroups.com> <1nbcfi99y0fkg.1h5ox2lj73okx$.dlg@40tude.net> <59acf311-3a4a-4eda-95a3-22272842305e@m16g2000yqc.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4b150869$0$6732$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 01 Dec 2009 13:13:29 CET NNTP-Posting-Host: 3e3f621d.newsspool2.arcor-online.net X-Trace: DXC=TWd`YF8ol7O=8m7nZkdN^@A9EHlD;3YcB4Fo<]lROoRA8kFJLh>_cHTX3jMdfSd0bL?:XJ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8263 Date: 2009-12-01T13:13:29+01:00 List-Id: Robert A Duff schrieb: > stefan-lucks@see-the.signature writes: > >> On Sun, 22 Nov 2009, Robert A Duff wrote: >> >>> Ada uses the term "assignment" to refer to both "initial assignment / >>> initialization" and "assignment_statement / overwriting". >>> I'd prefer to use different symbols for the two. >>> We're not going to change Ada in that regard, for compatibility reasons, >>> but I'm thinking in my hobby language design to use the term "assignment" >>> for the initial one, and "reassignment" for the subsequent overwriting >>> one, and use different symbols for the two. >>> >>> So, for a limited type, "assignment" is legal, "reassignment" is not. >> Distinguishing the two different operations which are written as ":=" in >> Ada by using different words and even different symbols would make a lot of >> sense. > > I definitely want to use different symbols as well as different words. Am I correct in assuming that one important part of this argument is about referring to the value stored for some variable before this store has a "reasonable" value? (Where "reasonable" does not currently have a meaning that can be inferred from the LRM, I guess.) If so, and presuming the programming language Ada is very much, and explicitly, about storing and manipulating bits in registers, memory words, ... of digital computers in a strongly typed fashion: In this case I would know the use of being carried away by functional, uhm, phantasm, pardon the expression. Rather, why not have Ada turn warnings about "uninitialized" variables into a rule like Java's? Then we could rely on the language: compilers will detect uninitialized variables provided these do not have a pragma/keyword/... to say that uninitialized is what the programmer wants. Some fancy means to tell the compiler that this variable does indeed have a good first value like pragma Import. X : [constant] Car; -- default init, -- undefined, -- junk bits. Doesn't matter -- *no* pragma Import (Ada, X); begin Spare := X.Tire (5); -- would become illegal, -- as no value has been assigned yet. -- Currently, we get a warning if Fast then X := Ferrari.Make (...); else X := Fiat.Make (...); end if; Spare := X.Tire (5); Does the phrase "first value" make sense?