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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Oberon and Wirthian languages Date: Fri, 25 Apr 2014 16:55:02 -0500 Organization: Jacob Sparre Andersen Research & Innovation 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> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1398462903 29027 69.95.181.76 (25 Apr 2014 21:55:03 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 25 Apr 2014 21:55:03 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:19590 Date: 2014-04-25T16:55:02-05:00 List-Id: "Simon Clubley" wrote in message news:ljekbl$bbt$1@dont-email.me... > 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 ? I prefer the partial aggregate approach; it comes up so often in practice and compilers have to bend over backwards to optimize the case. (The Janus/Ada compiler is stuffed with such aggregates that change a discriminant but little else of the content, I spent several weeks writing optimizations so that doesn't necessarily copy everything in a large record. But of course that has to be turned off for volatile and atomic objects.) But the syntax proposed doesn't have the right "feel". The connotation of the syntax has to match fairly closely the semantics of a feature, especially when we're in nice-to-have territory as this is. (After all, temporaries work; they might be a bit ugly but that's hardly a reason for a language feature.) This is a case where the keyword will make all of the difference. If we were using a new keyword, perhaps something like: A := (A replacing C => D, E => F); would do the trick. I don't find your Pascal-derived idea very appealing, because its so foreign to Ada. Something based on aggregates feels more in tune with the rest of the language. To get assignment atomicity, probably extending the aspect syntax to statements would be best. (The Parallel proposals are thinking in that direction anyway.) Then something like: A := (A replacing C => D, E => F) with Atomic; would mean to do an atomic update of A replacing the C and E components, leaving the rest untouched. Randy.