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!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Operation can be dispatching in only one type Date: Mon, 30 Nov 2009 15:36:53 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <025105f2-5571-400e-a66f-ef1c3dc9ef32@g27g2000yqn.googlegroups.com> <1h9hilcg5i6il.12edpgu4szw1h.dlg@40tude.net> <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> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1259613405 6133 192.74.137.71 (30 Nov 2009 20:36:45 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 30 Nov 2009 20:36:45 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:cqFtPeK0VphTPwlAUn8WGkE8IE4= Xref: g2news1.google.com comp.lang.ada:8255 Date: 2009-11-30T15:36:53-05:00 List-Id: 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. But I'm not sure what symbols to choose. Maybe := and :== . I want to allow: X : Integer; if ... then X := 0; -- initialize (what I want to call "assign") else X := 1; -- initialize (what I want to call "assign") end if; while ... loop X :== X + 1; -- overwriting (what I want to call "reassign") ... end loop; > But it is quite a standard notion to write "assignment" for overwriting > the current value of a variable by a new value. Well, the term is used in many non-functional languages for both cases: overwriting junk-bits with a value, and overwriting a previously-assigned value with a value. This is presumably because in those languages, there's no important difference between the two. In functional languages, the term "single assignment" is sometimes used, which means you can initialize a variable, but you can never overwrite. >... This notion is widely > used, much beyond Ada. You would likely confuse people by calling that > operation a "reassignment" and using "assignment" for anther kind of > operation. Please don't do that! Well, the word "reassignment" contains the word "assignment" -- it means "to assign again". I don't see why that would be confusing. Ada (to keep this slightly on topic ;-)) of course uses "assignment" for both kinds: initialization and assignment_statement. I find that confusing, because you'd think "assignment_statement" is the (only) thing that does "assignment". > Better use "assignment" for the overwriting operation, and another word > (such as "initial assignment", "constructive assignment", "inisignment", > ... a native English speaker might find better words) for the type of > assignment that does not overwrite an existing value, and which is allowed > for limited types. Thanks for the advice, but I'm not sure I'm convinced to take it. If we agree that there are two different kinds of things called "assignment" in common languages, I don't see why one should deserve the term "assignment" in preference to the other... - Bob