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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Oberon and Wirthian languages Date: Fri, 25 Apr 2014 21:33:42 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <1ljwj8f.1wqbhvuabsdw1N%csampson@inetworld.net> <51c7d6d4-e3be-44d5-a4ce-f7e875345588@googlegroups.com> <%J32v.70539$kp1.45343@fx14.iad> <8761m535e4.fsf_-_@ludovic-brenta.org> Injection-Date: Fri, 25 Apr 2014 21:33:42 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e458ff8b81bc0c159989eb0e36c6e372"; logging-data="11645"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4O8hOrTJxIXuABGTGt1/FYT0YRsx3dm0=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:VfFfJPg4TQjEbra8/9WLhyew49A= X-Original-Bytes: 4105 Xref: number.nntp.dca.giganews.com comp.lang.ada:186088 Date: 2014-04-25T21:33:42+00:00 List-Id: On 2014-04-24, Randy Brukardt wrote: >> On 14-04-24 21:51 , Simon Clubley wrote: > ... >>> It will be interesting to see if Randy and company have any comments on >>> this syntax. > > Not really, other than that someone needs to come up with syntax that has > the right "feeling". None of the proposals I've seen have that yet, but keep > trying. > Ideas on what you think is wrong with the current suggestions will be useful. Do you have some general approach in mind which you would prefer ? For example, do you think it should be done as part of an assignment statement as Niklas is suggesting, or something more Pascal like as I was thinking of ? I would not want to see something fully Pascal like, with random statements within the with, but something directed towards updating the variable only. I also now think the atomic on the statement may be redundant as it can be made a part of the variable definition using the atomic pragma. My revised version looks like this: update uart0.config1 using .flag1 := 0; .enable := 1; .txdis := 0; end update; I think the leading dot is required to positively identify something as a member of config1 (in this case) and avoid conflicts between variable definitions. However, I'm also tempted to ban the use of config1 component references on the RHS of the assignment. This avoids issues, if the component is modified within the update statement, around whether the component value used on the RHS is the value on entry to the update statement or the modified value. There would also have to be wording along the lines of "An atomic variable shall be read exactly once and written exactly once by the update statement. The compiler must reject the update statement if this cannot be achieved." Although my current preference is for something like the above, as an alternative, would you be open to a new assignment operator which was used for "updates" instead of "becomes" semantics ? Something along the lines of: uart0.config1 {updates_operator} (flag1 => 0, enable => 1, txdis = 0); or uart0.config1'Update := (flag1 => 0, enable => 1, txdis = 0); although I'm not sure what characters would be used for the updates_operator. Once again, the atomic update would be enforced by the atomic pragma. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world