From: Maciej Sobczak on 6 Apr 2010 04:07 On 6 Kwi, 02:38, Robert A Duff <bobd...(a)shell01.TheWorld.com> wrote: > > Is there a way to redefine this so one need to only write V(5) ? > > Not yet. > > There is a proposal for this for Ada 2012. Interesting. Is this proposal publicly available? The ability to overload the function call and indexing operators in C+ + is one of the most important language features and its presence in Ada would be a very welcome addition. It is only a pity that there would be no way to overload a function call operator for the parameterless case. ;-) -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4
From: Adam Beneschan on 6 Apr 2010 11:04 On Apr 3, 10:30 pm, "J-P. Rosen" <ro...(a)adalog.fr> wrote: > This kind of remark comes generally from hear-say of people who never > had a serious look at Ada. Unfortunately, it is easier to repeat a rumor > than to investigate seriously... What's really sad is when a physics professor does that. Aren't scientists supposed to be the ones who test and investigate things? -- Adam
From: Georg Bauhaus on 6 Apr 2010 17:55 On 4/6/10 10:07 AM, Maciej Sobczak wrote: > On 6 Kwi, 02:38, Robert A Duff<bobd...(a)shell01.TheWorld.com> wrote: > >>> Is there a way to redefine this so one need to only write V(5) ? >> >> Not yet. >> >> There is a proposal for this for Ada 2012. > > Interesting. Is this proposal publicly available? I guess it is this one: http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0139-2.txt
From: Nasser M. Abbasi on 6 Apr 2010 22:52 "Georg Bauhaus" <rm-host.bauhaus(a)maps.futureapps.de> wrote in message news:4bbbadbe$0$6980 > > I guess it is this one: > > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0139-2.txt > > Thanks for the link. Yes, I see this: "Essentially we are allowing a container to be "indexed" in the same way as an array is indexed, with the key (or potentially various different key types) being arbitrary. " http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0139-2.txt?rev=1.5 This sounds good. Any guess when will gnat have this? 2012, 2013, 2014? --Nasser
From: Maciej Sobczak on 7 Apr 2010 03:28
On 6 Kwi, 10:07, Maciej Sobczak <see.my.homep...(a)gmail.com> wrote: > It is only a pity that there would be no way to overload a function > call operator for the parameterless case. ;-) Heck, when I think more about this it seems that even this would be possible by analyzing the context of the given expression. That would work in a similar way as overloading on return types. For example, assuming that My_Magic_Type has an overloaded procedure call operator and My_Other_Magic_Type has an overloaded function call operator: declare X : My_Magic_Type; Y : My_Other_Magic_Type; begin X; -- parameterless procedure call on X A := Y; -- parameterless function call on Y X (1, 2); -- procedure call on X with two params B := Y (3); -- function call on Y with one param end; But I'm not really sure if that would be actually useful in the context of other Ada features. Especially - the only place where it would make sense is with generics, but then their specification syntax would blow up even more. You cannot have everything, I guess... -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4 |