Prev: Lost in translation (with SPARK user rules)
Next: Sockets package in SPARK (Was: Lost in translation (with SPARK user rules))
From: Maciej Sobczak on 9 Jun 2010 09:54 On 9 Cze, 11:24, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de> wrote: > > By "polymorphism" I meant the parametrisation based on dynamic > > dispatch, > > This is a specific form of polymorphism. Yes, of course, there is also overloading as so-called "ad-hoc polymorphism", etc. I'm perfectly convinced that *everybody* understood what I meant in this particular context, especially when the context itself contained many references to virtual functions and object-orientation. What is the purpose of your argument, then? Are we having a dispute just for the sake of having it? > > also known as object-orientation. > > There are different opinions on whether OO is limited to dynamic > polymorphism. In which case we will never finish debating. > > Note, for example, that containers in C++ have no common base class/ > > interface. In Ada this is similar. > > There is a common base, which is just not explicit. And you just forgot to explain what it is. Could you please elaborate on this? What is the common base class/interface for C++ or Ada containers? How can I use it? -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4
From: Dmitry A. Kazakov on 9 Jun 2010 10:29 On Wed, 9 Jun 2010 06:54:18 -0700 (PDT), Maciej Sobczak wrote: > On 9 Cze, 11:24, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de> > wrote: > >>> Note, for example, that containers in C++ have no common base class/ >>> interface. In Ada this is similar. >> >> There is a common base, which is just not explicit. > > And you just forgot to explain what it is. Could you please elaborate > on this? > What is the common base class/interface for C++ or Ada containers? generic type Element is private; package Generic_Stack is type Stack is limited private; ... end Generic_Stack; The common base is the [generic] interface of Stack, which all instances share, which every programmer has in mind talking about stack. > How can I use it? You cannot, which is the problem of generics. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
From: Yannick DuchĂȘne (Hibou57) on 9 Jun 2010 10:31 Le Wed, 09 Jun 2010 11:24:16 +0200, Dmitry A. Kazakov <mailbox(a)dmitry-kazakov.de> a Ă©crit: > There are different opinions on whether OO is limited to dynamic > polymorphism. So what else ? You meant static polymorphism ? -- There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.
From: Georg Bauhaus on 9 Jun 2010 11:02 On 09.06.10 16:29, Dmitry A. Kazakov wrote: > The common base is the [generic] interface of Stack, which all instances > share, which every programmer has in mind talking about stack. > >> How can I use it? > > You cannot, which is the problem of generics. Maybe with the exception of generic formal packages? (With other problems popping up elsewhere.)
From: Dmitry A. Kazakov on 9 Jun 2010 11:53
On Wed, 09 Jun 2010 17:02:03 +0200, Georg Bauhaus wrote: > On 09.06.10 16:29, Dmitry A. Kazakov wrote: > >> The common base is the [generic] interface of Stack, which all instances >> share, which every programmer has in mind talking about stack. >> >>> How can I use it? >> >> You cannot, which is the problem of generics. > > Maybe with the exception of generic formal packages? > (With other problems popping up elsewhere.) Close, but it is about compilation units, the abstraction of the contents remains outside the language. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de |