Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: What is this angle bracket notation?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Aug 21, 2017 9:33 AM Last Post By: G. Smith Threads: [ Previous | Next ]
G. Smith

Posts: 44
Registered: 5/3/03
What is this angle bracket notation?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2017 5:43 AM
In the XE8 help documentation (Delphi Language Reference/Classes and Objects/Methods/Class contstructors) is the following code segment:

type
TBox = class
private
class var FList: TList<Integer>;
class constructor Create;
end;

and later it talks about the TList<String> class.

Can someone please explain what the <Integer> and <String> notation is supposed to indicated. And where, please, is it documented?
Robert Evans

Posts: 114
Registered: 10/16/99
Re: What is this angle bracket notation?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2017 6:27 AM   in response to: G. Smith in response to: G. Smith
In article <930329 at forums dot embarcadero dot com>, G. Smith <?@?.?.invalid>
wrote
In the XE8 help documentation (Delphi Language Reference/Classes and
Objects/Methods/Class contstructors) is the following code segment:

type
TBox = class
private
class var FList: TList<Integer>;
class constructor Create;
end;

and later it talks about the TList<String> class.

Can someone please explain what the <Integer> and <String> notation is
supposed to indicated.

It declares that the associated type generic is to be regarded as being
of type Integer / String.

And where, please, is it documented?

Many places. Fror starters, search for "generics" in the help or see
http://docwiki.embarcadero.com/RADStudio/XE8/en/Generics_index
or read chapter 14 in Marco's Object Pascal Handbook.

--
Bob Evans
G. Smith

Posts: 44
Registered: 5/3/03
Re: What is this angle bracket notation?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2017 7:27 AM   in response to: Robert Evans in response to: Robert Evans
Robert Evans wrote:
In article <930329 at forums dot embarcadero dot com>, G. Smith <?@?.?.invalid>
wrote
In the XE8 help documentation (Delphi Language Reference/Classes and
Objects/Methods/Class contstructors) is the following code segment:

type
TBox = class
private
class var FList: TList<Integer>;
class constructor Create;
end;

and later it talks about the TList<String> class.

Can someone please explain what the <Integer> and <String> notation is
supposed to indicated.

It declares that the associated type generic is to be regarded as being
of type Integer / String.

And where, please, is it documented?

Many places. Fror starters, search for "generics" in the help or see
http://docwiki.embarcadero.com/RADStudio/XE8/en/Generics_index
or read chapter 14 in Marco's Object Pascal Handbook.

--
Bob Evans

Many thanks.

I will now learn about "generics" - a subject I think I've encountered but dismissed as possibly being "another complicating abstraction". I'll see.
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: What is this angle bracket notation?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2017 8:11 AM   in response to: G. Smith in response to: G. Smith
G. Smith wrote:

In the XE8 help documentation (Delphi Language Reference/Classes and
Objects/Methods/Class contstructors) is the following code segment:

type
TBox = class
private
class var FList: TList<Integer>;
class constructor Create;
end;

FWIW, what is with the * notation? Code is marked thus:

  type
    TBox = class
    etc...


See legend on the right.

--
Rudy Velthuis http://www.rvelthuis.de

"Time is a drug. Too much of it kills you."
-- Terry Pratchett (Small Gods)
G. Smith

Posts: 44
Registered: 5/3/03
Re: What is this angle bracket notation?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2017 9:33 AM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy Velthuis (TeamB, MVP) wrote:
G. Smith wrote:

In the XE8 help documentation (Delphi Language Reference/Classes and
Objects/Methods/Class contstructors) is the following code segment:

type
TBox = class
private
class var FList: TList<Integer>;
class constructor Create;
end;

FWIW, what is with the * notation? Code is marked thus:

Thank you for that. I didn't notice (bother reading) that help block on the right. I did notice the B (for bold) on the top panel, highlighted the text and clicked the B.

I'll try to do better next time.


  type
    TBox = class
    etc...


See legend on the right.

--
Rudy Velthuis http://www.rvelthuis.de

"Time is a drug. Too much of it kills you."
-- Terry Pratchett (Small Gods)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02