From: Dmitry A. Kazakov on
On Thu, 10 Jun 2010 12:10:02 +0200, Georg Bauhaus wrote:

> On 10.06.10 11:07, Dmitry A. Kazakov wrote:
>
>> I call this type algebra. There are operations that yield types from types
>> and values. Generic instantiation is such an operation. Derivation is
>> another. Array declaration is third. Type constraining is forth, etc.
>>
>> If I were ARG, I would consider the algebraic type operations the language
>> needs, with the goals:
>>
>> 0. SIMPLIFY THE LANGUAGE
>> 1. Reduce generics use no absolute minimum (without performance penalty)
>> 2. Most of currently built-in types must become library-defined
>> 3. The standard container library must be freed of generics
>> 4. The problem of container subtypes to be solved (e.g. when and how a
>> container of subtypes becomes a subtype or not)
>> 5. The problem of containers of class-wides to be solved (+ relation of a
>> container of class-wides to a container of specific types, when, how)
>
> What will be the type of a non-generic package?

Packages have no types.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Maciej Sobczak on
On 10 Cze, 10:15, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de>
wrote:

> > The appendThreeInts function uses the implicit common interface, even
> > though vector and list do not share anything explicitly.
>
> You didn't use it.

I used it in the same way as I can use (for example) the addition
operator for integer literals.

> Nowhere in the program it was manifested.

Just as the addition operator for integer literals?

The fact that something has no declared name in the program does not
mean that it doesn't exist.

--
Maciej Sobczak * http://www.inspirel.com

YAMI4 - Messaging Solution for Distributed Systems
http://www.inspirel.com/yami4
From: Alex R. Mosteo on
Georg Bauhaus wrote:

> On 10.06.10 10:57, Vadim Godunko wrote:
>> On Jun 10, 11:20 am, AdaMagica <christoph.gr...(a)eurocopter.com> wrote:
>>> On 10 Jun., 08:34, Vadim Godunko <vgodu...(a)gmail.com> wrote:
>>>
>>>> I want to known more about how to use OOP in Ada without access types!
>>>
>>> type Element is tagged ...
>>> subtype Any_Element is Element'Class;
>>>
>>> procedure Show (E: Element);
>>>
>> Thank you for example, this is example of dispatching but not use of
>> Ada in heavy OOP style of programming. :-)
>
> Will it, in theory, be possible to write a Qt-like library
> in Ada such that client programs declare variables like
>
> W : Some_Window'Class := Some_Lib_Pack.Make (Typ => Some_Id);
>
> That is, programs do not use access Some_Window'Class?

Interesting question, because e.g. in GtkAda I found the use of renamed
access types most confusing at first.

I guess Vadim is the man to answer about Qt + Ada :)
From: Alex R. Mosteo on
Martin Krischik wrote:

(...)

>
> function f returns Integer
>
> package i is
> g : Integer := 0;
> end i;
>
> begin
> i.g := i.g + 1;
> return i.g;
> end f;

Do you mean that i.g retains value across calls here? Never saw this
construct before, and not what I would have thought... interesting.
From: Dmitry A. Kazakov on
On Thu, 10 Jun 2010 06:37:28 -0700 (PDT), Maciej Sobczak wrote:

> On 10 Cze, 10:15, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de>
> wrote:
>
>>> The appendThreeInts function uses the implicit common interface, even
>>> though vector and list do not share anything explicitly.
>>
>> You didn't use it.
>
> I used it in the same way as I can use (for example) the addition
> operator for integer literals.

(Integer literals have one type Universal_Integer)

More generally the type "abstract integer" exists, but cannot be properly
used in Ada. In generics it is referenced as "range <>". This is a design
flaw and the same problem.

> The fact that something has no declared name in the program does not
> mean that it doesn't exist.

It means that it does not exist in the program. It may exist in the
programmer's head, one the paper etc, but that is irrelevant to the
language.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de