Prev: Tiny mistaken on an AdaPower page
Next: Initialization and Finalization of limited object "returned"by a function
From: (see below) on 12 Feb 2010 14:10 On 12/02/2010 16:57, in article 9c2b5c56-7abf-4523-844d-b48447587402(a)w27g2000pre.googlegroups.com, "Adam Beneschan" <adam(a)irvine.com> wrote: > I also remember some of the attempted rationalizations at the time; in > particular, why did Ada use parentheses for both subprogram calls and > array indexing, when other popular languages (Pascal and C) used > square brackets for indexing. Someone came up with an argument that > it was actually a good thing to use the same characters for both, > because then if your program uses Arr(Index), where Arr is an array, > you could redesign your program to make "Arr" a function and the > change would be transparent. That seemed like a stretch at the time. Douglas T. Ross, the author of AED-0, was keen on the idea of "uniform referent" notation, i.e., using the form F(X) for a function call, an array element, or the field F of record X (as in Algol W). I think it had some merit, although much diminished by the invention of opaque/private types. -- Bill Findlay <surname><forename> chez blueyonder.co.uk
From: Randy Brukardt on 12 Feb 2010 20:54 "Hibou57 (Yannick Duch�ne)" <yannick_duchene(a)yahoo.fr> wrote in message news:8a8514af-0d80-4acc-a2de-d7128c345d97(a)b7g2000yqd.googlegroups.com... .... >Better than an aggregate for protected and task, there should be >something acting like an empty aggregate, which would be to be used as >an initializer for protected and task only. Right. That's what we were trying to do for Ada 2005, and it just didn't work out. It's weird that you can default initialize a component in an aggregate with <>, but there is no way to do that for an entire object. We also wanted to be able to default initialize the private part of an extension. But we ran into all kinds of weird problems. I don't plan to go there again myself, there were enough people who didn't like anything involving "others". Randy.
From: (see below) on 13 Feb 2010 10:52 On 13/02/2010 09:54, in article jk97b2c81itt$.1h9s6uejsnxcu.dlg(a)40tude.net, "Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> wrote: > On Fri, 12 Feb 2010 10:15:17 -0500, Robert A Duff wrote: > >> "Hibou57 (Yannick Duch�ne)" <yannick_duchene(a)yahoo.fr> writes: >> >>> On 12 f�v, 00:24, Robert A Duff <bobd...(a)shell01.TheWorld.com> wrote: >>>> Well, I don't find it "graceful" that single-element positional >>>> aggregates are not allowed. �And zero-element ones. �I think >>>> it's just bad language design. >>> It seems you are suggesting the ambiguity should be resolved >>> semantically. Why not :) >> >> No, it should be syntactic. And it should be more obvious >> than counting the number of expressions between "(" and ")". >> >> Aggregates should use "[" and "]", so there's no confusion. > > Nope, the mathematical notation for a tuple is as in Ada (a,b,c,...), so > should it be. I see no problem in having it ambiguous (overloaded). <a,b,c, ...>, surely? -- Bill Findlay <surname><forename> chez blueyonder.co.uk
From: Robert A Duff on 13 Feb 2010 10:59 "Hibou57 (Yannick Duch�ne)" <yannick_duchene(a)yahoo.fr> writes: > What's the new Professor Sir Tucker Taft's project ? The ARG is inventing some syntactic sugar to make user-defined container code easier to read, and Tucker is doing most of the work on that. One example is that there will probably be some mechanism to say: A(X) := A(X) + 1; where A is (say) a hash table mapping strings to integers, and X is a string. User-defined array-indexing notation. Also, some new kinds of for loops. For example, looping through the components of an array without any horsing around with index values: for C : Character of My_String loop Do_Something(C); end loop; The ": Character" above is optional, according to the latest proposal. - Bob
From: Robert A Duff on 13 Feb 2010 14:45
"Hibou57 (Yannick Duch�ne)" <yannick_duchene(a)yahoo.fr> writes: > So that's to be added with the other project I've heard about here at > comp.lang.ada, about first-class-functions (it was during the thread > about making constant declarations overloadable if my mind is right) > and the pre-post-condition discussed here and on fr.c.l.a. > > As Santa Claus seems to be actually checking orders, do you know if > there will be something like co-routines ? We already have tasks, but > tasks are a bit too much heavy as co-routines. No, probably not. Probably no first-class functions, either. - Bob |