> Peter Vreman wrote:
>> Expiriment, feed g++ code with errors in the statements. With macro's
>> those errors won't be show until the macro is used. But with templates
>> this is diffent:
>
> Smart indeed :)
>
>> This is more important than the syntactical sugar. The rules where to
>> declare gene
Peter Vreman wrote:
Expiriment, feed g++ code with errors in the statements. With macro's
those errors won't be show until the macro is used. But with templates
this is diffent:
Smart indeed :)
This is more important than the syntactical sugar. The rules where to
declare generics and how/when
> Peter Vreman wrote:
>> I did some tests with g++. It looks like it parses the template
>> 'normally'
>> and don't handle it like a macro. When instantiating the template the
>> generic type is replaced.
>
> What tests did you do to come to this conclusion ? I mean, how can one
> see how g++ parse
On Friday 04 November 2005 13:48, Vinzent Hoefler wrote:
Stupid KMail. Deleted the text after file's eof.
After the file there was supposed to be a remark about that the example
does not compile as is, because generics in Ada are different from C++
templates, which are merely more like macros,
On Friday 04 November 2005 13:27, Marco van de Voort wrote:
["<>"]
> The evil is in
>
> - using characters instead of modifiers.
> - worse, recycling already used characters.
Alright, I completely understand at least the first part, so perhaps
they should simply not be overused. :-)
Just for th
Peter Vreman wrote:
I did some tests with g++. It looks like it parses the template 'normally'
and don't handle it like a macro. When instantiating the template the
generic type is replaced.
What tests did you do to come to this conclusion ? I mean, how can one
see how g++ parses things ?
f
> Micha Nelissen wrote:
>>
>> type
>> TGenericCollection = generic(T: TCollectionItem) class(TComponent)
>> ...implement TCollection and use T
>> end;
>>
>> TCollection = TGenericCollection of (TCollectionItem);
>> TFieldDefs = TGenericCollection of (TFieldDef);
>>
>
> So generic procs
> types _at least_ in Ada's generics back in 1983[*] already.
> Perhaps someone should take a look at those, because these are also
> quite different from C++-templates.
>
>
> Vinzent.
>
> [*] That would be the same year the term "C++" just appeared first in
> history of programming languages
Mattias Gaertner wrote:
On Fri, 04 Nov 2005 13:44:55 +0100
Marc Weustink <[EMAIL PROTECTED]> wrote:
Mattias Gaertner wrote:
On Fri, 04 Nov 2005 10:47:42 +0100
Marc Weustink <[EMAIL PROTECTED]> wrote:
Daniël Mantione wrote:
Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
Here is a p
On Friday 04 November 2005 13:00, Micha Nelissen wrote:
> Combining some of the wiki ideas, and has no "evil" <> characters
> :-).
I don't understand the fuzz about using "<>". It's not even close to
being C(++)-ish, because it was used for describing discrete range
types _at least_ in Ada's ge
Micha Nelissen wrote:
type
TGenericCollection = generic(T: TCollectionItem) class(TComponent)
...implement TCollection and use T
end;
TCollection = TGenericCollection of (TCollectionItem);
TFieldDefs = TGenericCollection of (TFieldDef);
So generic procs could look like:
function
Ales Katona wrote:
Example:
procedure MyProc(T); // generic procedure without parameters
ver i: T;
begin
...
end;
procedure MyProc(T: TClass); // non generic procedure
begin
end;
Call
MyProc(TObject);
What will happen?
Mattias
Sky will reign fire:
procedure (var T);
begin
// gener
Ales Katona wrote:
Are the () required? Why not TSomeList = TGenericList of Pointer; ?
I guess, but in general one can use multiple generic types when coding a
class, so this is to point out that it's ordered and defined.
Micha
___
fpc-devel maill
Ales Katona wrote:
Micha Nelissen wrote:
Marc Weustink wrote:
BTW,
what woud be the problem with
type
TMySpecificClass = TGenericClass(TObject, Integer);
Or:
type
TGenericCollection = generic(T: TCollectionItem) class(TComponent)
...implement TCollection and use T
end;
TColl
Example:
procedure MyProc(T); // generic procedure without parameters
ver i: T;
begin
...
end;
procedure MyProc(T: TClass); // non generic procedure
begin
end;
Call
MyProc(TObject);
What will happen?
Mattias
Sky will reign fire:
procedure (var T);
begin
// generic or not??
end;
___
Micha Nelissen wrote:
Marc Weustink wrote:
BTW,
what woud be the problem with
type
TMySpecificClass = TGenericClass(TObject, Integer);
Or:
type
TGenericCollection = generic(T: TCollectionItem) class(TComponent)
...implement TCollection and use T
end;
TCollection = TGenericColl
On Fri, 04 Nov 2005 13:44:55 +0100
Marc Weustink <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote:
> > On Fri, 04 Nov 2005 10:47:42 +0100
> > Marc Weustink <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Daniël Mantione wrote:
> >>
> >>>Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
> >>>
> >>>
> >>>
>
Marc Weustink wrote:
BTW,
what woud be the problem with
type
TMySpecificClass = TGenericClass(TObject, Integer);
Or:
type
TGenericCollection = generic(T: TCollectionItem) class(TComponent)
...implement TCollection and use T
end;
TCollection = TGenericCollection of (TCollectionItem
Mattias Gaertner wrote:
On Fri, 04 Nov 2005 10:47:42 +0100
Marc Weustink <[EMAIL PROTECTED]> wrote:
Daniël Mantione wrote:
Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
Here is a proposal of the syntax:
type
TGenericClass = class
public
procedure Add(Item: T; Flag: F);
end;
This sy
On Fri, 04 Nov 2005 10:47:42 +0100
Marc Weustink <[EMAIL PROTECTED]> wrote:
> Daniël Mantione wrote:
> >
> > Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
> >
> >
> >>Here is a proposal of the syntax:
> >>
> >>type
> >> TGenericClass = class
> >> public
> >>procedure Add(Item: T; Flag: F)
Daniël Mantione wrote:
>
> Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
>
>
>>Here is a proposal of the syntax:
>>
>>type
>> TGenericClass = class
>> public
>>procedure Add(Item: T; Flag: F);
>> end;
>
>
> This syntax is almost impossible to implement since in one of your other
> mai
Daniël Mantione wrote:
Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
Here is a proposal of the syntax:
type
TGenericClass = class
public
procedure Add(Item: T; Flag: F);
end;
This syntax is almost impossible to implement since in one of your other
mails the symbols to mark the para
On Thu, 03 Nov 2005 22:35:34 +0100
Peter Vreman <[EMAIL PROTECTED]> wrote:
> At 20:41 3-11-2005, you wrote:
> >On Thu, 3 Nov 2005 20:25:07 +0100 (CET)
> >Daniël Mantione <[EMAIL PROTECTED]> wrote:
> >
> > >
> > >
> > > Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
> > >
> > > > Right. I didn't thi
At 20:41 3-11-2005, you wrote:
On Thu, 3 Nov 2005 20:25:07 +0100 (CET)
Daniël Mantione <[EMAIL PROTECTED]> wrote:
>
>
> Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
>
> > Right. I didn't think of that.
> >
> > What about edged brackets?
> >
> > type
> > TGenericClass[T,F] = class
> > public
On Thu, 3 Nov 2005 20:25:07 +0100 (CET)
Daniël Mantione <[EMAIL PROTECTED]> wrote:
>
>
> Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
>
> > Right. I didn't think of that.
> >
> > What about edged brackets?
> >
> > type
> > TGenericClass[T,F] = class
> > public
> > procedure Add(Item:
Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
> Right. I didn't think of that.
>
> What about edged brackets?
>
> type
> TGenericClass[T,F] = class
> public
> procedure Add(Item: T; Flag: F);
> end;
At first sight it looks okay. If necessary it is possible to introduce a
two charac
On Thu, 3 Nov 2005 20:10:35 +0100
Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> On Thu, 3 Nov 2005 19:59:40 +0100 (CET)
> Daniël Mantione <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
> >
> > >
> > > Here is a proposal of the syntax:
> > >
> > > type
On Thu, 3 Nov 2005 19:59:40 +0100 (CET)
Daniël Mantione <[EMAIL PROTECTED]> wrote:
>
>
> Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
>
> >
> > Here is a proposal of the syntax:
> >
> > type
> > TGenericClass = class
> > public
> > procedure Add(Item: T; Flag: F);
> > end;
>
> Thi
Op Thu, 3 Nov 2005, schreef Mattias Gaertner:
>
> Here is a proposal of the syntax:
>
> type
> TGenericClass = class
> public
> procedure Add(Item: T; Flag: F);
> end;
This syntax is almost impossible to implement since in one of your other
mails the symbols to mark the parameters
Here is a proposal of the syntax:
type
TGenericClass = class
public
procedure Add(Item: T; Flag: F);
end;
procedure TGenericClass.Add(Item: T; Flag: F);
// Note: No redundant after TGenericClass.
begin
end;
I think, the parameters should be at the identifier name, not in the class
b
30 matches
Mail list logo