From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Ada Interfaces and the Liskov Substitution Principle
Date: 30 May 2007 00:40:14 -0700
Date: 2007-05-30T00:40:14-07:00 [thread overview]
Message-ID: <1180510814.812025.251580@u30g2000hsc.googlegroups.com> (raw)
In-Reply-To: <eypo9v4rr1fe$.4brnh01xlmc5$.dlg@40tude.net>
On 29 Maj, 19:07, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> > We are talking about real:
>
> > X := Y;
>
> Huh, how are going to design a non-referential container of T'Class?
I don't. :-)
Polymorphism and references come hand in hand if you need the ability
to reassign. Copy-initialization is the only place where you can
safely get away with "values" of T'Class.
I think that the mess has its source in the push to have T'Class
behaving like normal value.
> > I say that you need one type String, that possibly uses strategy
> > internally to delegate details like encoding. You don't need encoding
> > to "leak out" at the level of types that the final user operates on.
>
> That would be indeed a mess. How would you pass an UTF-8 string to GTK+
> which knows nothing about your fancy patterns?
Then it should know. Otherwise there is no way it can interpret
correctly what I pass as parameters, unless you want to have
"implicit" conversions for parameters.
> Why don't you use the
> advantages of the types system?
I do use it, I just don't elevate implementation details to the level
of type that is handled directly by the user.
> > You can (and should) have dispatching internally in the implementation
> > of operations of String. I'm not proposing any case statements here!
>
> Here you are. What is the difference between internally and externally
> dispatching assignments?
Assignment is an operation that is meaningful syntactically - that's
why it is so tempting. Internally you can have anything else,
including regular subprogram calls that will do necessary conversions.
> >> Why a fixed string
> >> shouldn't be assigned to an unbounded one and reverse?
>
> > Of course it should!
>
> q.e.d.
>
> > What about template methods? ;-)
>
> Static polymorphism is exactly what I am trying to get rid of... (:-))
Here you are. :-)
Then we will never get into any agreement.
> Static polymorphism does not allow mixing types.
?
> Further you cannot design
> a library for formatting strings which would not be generic itself.
1. So?
2. Yes, I can. Just use arbitrary string type for formatting and then
convert to the destination type.
> Generics is a dead end.
Hm...
> > Looks like you guys need *real* templates. ;-)
>
> Surely they have them ... for formatting RM texts. See the difference?
> (:-))
:-)
> > But then the compiler would need to either force you to implement the
> > whole square of assignment operations, or use run-time checks to
> > discover whether the assignment within a given pair of leaf types is
> > provided.
> > The former is unrealistic with evolving or open-ended hierarchies, the
> > latter smells more like Python than Ada.
>
> The latter is what Ada does now, and I agree that this is not Ada (TM).
Agreed.
> The former is quite possible and IMO is the only right way to go. Note that
> the language should also allow declaring symmetries of the methods to
> reduce the number of independent variants.
Yes, but that reduces the complexity by a constant only, the problem
is still fundamentally squared.
--
Maciej Sobczak
http://www.msobczak.com/
next prev parent reply other threads:[~2007-05-30 7:40 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-23 19:47 Ada Interfaces and the Liskov Substitution Principle Stefan Lucks
2007-05-23 20:32 ` Ludovic Brenta
2007-05-23 22:00 ` Randy Brukardt
2007-05-24 0:56 ` Anh Vo
2007-05-24 18:27 ` Pascal Obry
2007-05-24 18:39 ` Dmitry A. Kazakov
2007-05-24 18:51 ` Pascal Obry
2007-05-24 22:44 ` Randy Brukardt
2007-05-24 6:57 ` Stefan Lucks
2007-05-23 20:54 ` Maciej Sobczak
2007-05-23 21:58 ` Randy Brukardt
2007-05-24 7:29 ` Maciej Sobczak
2007-05-24 8:02 ` Dmitry A. Kazakov
2007-05-24 12:58 ` Maciej Sobczak
2007-05-24 13:42 ` Dmitry A. Kazakov
2007-05-24 22:08 ` Robert A Duff
2007-07-01 1:00 ` David Thompson
2007-05-24 22:58 ` Randy Brukardt
2007-05-25 7:52 ` Maciej Sobczak
2007-05-25 8:21 ` Dmitry A. Kazakov
2007-05-25 20:27 ` Maciej Sobczak
2007-05-26 7:48 ` Dmitry A. Kazakov
2007-05-27 8:30 ` Maciej Sobczak
2007-05-27 10:04 ` Dmitry A. Kazakov
2007-05-29 8:03 ` Maciej Sobczak
2007-05-29 13:18 ` Dmitry A. Kazakov
2007-05-29 13:32 ` Dmitry A. Kazakov
2007-05-29 15:34 ` Maciej Sobczak
2007-05-29 17:07 ` Dmitry A. Kazakov
2007-05-30 7:40 ` Maciej Sobczak [this message]
2007-05-30 8:43 ` Dmitry A. Kazakov
2007-05-30 12:54 ` Maciej Sobczak
2007-05-30 13:56 ` Dmitry A. Kazakov
2007-05-30 16:49 ` vgodunko
2007-05-30 20:52 ` Maciej Sobczak
2007-05-31 8:15 ` Dmitry A. Kazakov
2007-05-31 13:46 ` Maciej Sobczak
2007-06-01 7:29 ` Dmitry A. Kazakov
2007-06-01 13:32 ` Maciej Sobczak
2007-06-01 14:53 ` Dmitry A. Kazakov
2007-06-01 20:31 ` Maciej Sobczak
2007-06-02 8:19 ` Dmitry A. Kazakov
2007-06-02 16:49 ` Maciej Sobczak
2007-06-03 7:09 ` Dmitry A. Kazakov
2007-06-03 22:04 ` Maciej Sobczak
2007-06-04 8:08 ` Dmitry A. Kazakov
2007-06-04 17:02 ` Maciej Sobczak
2007-06-05 8:35 ` Dmitry A. Kazakov
2007-06-05 22:12 ` Maciej Sobczak
2007-06-06 8:21 ` Dmitry A. Kazakov
2007-06-06 14:46 ` Maciej Sobczak
2007-06-06 15:11 ` Maciej Sobczak
2007-06-06 15:32 ` Markus E Leypold
2007-05-24 10:42 ` Georg Bauhaus
2007-05-24 13:41 ` Dmitry A. Kazakov
2007-05-25 16:59 ` Markus E Leypold
2007-05-28 9:52 ` Georg Bauhaus
2007-05-28 11:50 ` Dmitry A. Kazakov
2007-05-28 23:32 ` Georg Bauhaus
2007-05-29 12:05 ` Dmitry A. Kazakov
2007-05-29 13:33 ` Georg Bauhaus
2007-05-29 17:29 ` Dmitry A. Kazakov
2007-05-29 20:46 ` Georg Bauhaus
2007-05-30 7:53 ` Dmitry A. Kazakov
2007-05-30 13:18 ` Georg Bauhaus
2007-05-31 10:27 ` Dmitry A. Kazakov
2007-05-31 11:44 ` Georg Bauhaus
2007-06-01 7:37 ` Dmitry A. Kazakov
2007-06-01 10:07 ` Markus E Leypold
2007-06-01 11:41 ` Georg Bauhaus
2007-06-01 13:07 ` Dmitry A. Kazakov
2007-05-28 13:47 ` Markus E Leypold
2007-05-28 23:12 ` Georg Bauhaus
2007-05-28 13:56 ` Markus E Leypold
2007-05-28 23:00 ` Georg Bauhaus
2007-05-24 7:39 ` Dmitry A. Kazakov
2007-05-24 11:12 ` Stefan Lucks
2007-05-24 13:56 ` Dmitry A. Kazakov
2007-05-24 14:41 ` Stefan Lucks
2007-05-24 15:46 ` Dmitry A. Kazakov
2007-05-24 15:00 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox