www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Class nomenclature

reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
Is there an established nomenclature for D class objects and variables?

- What do you call c0 and c1 below? "variable"? "reference"?

- What do you call the actual object? "instance"? "object"?

class C
{}

void main()
{
     auto c0 = new C;
     auto c1 = c0;
}

Thank you,
Ali
Jan 08 2010
parent "Simen kjaeraas" <simen.kjaras gmail.com> writes:
On Sat, 09 Jan 2010 01:24:56 +0100, Ali =C3=87ehreli <acehreli yahoo.com=
 wrote:

 Is there an established nomenclature for D class objects and variables=

 - What do you call c0 and c1 below? "variable"? "reference"?

 - What do you call the actual object? "instance"? "object"?

 class C
 {}

 void main()
 {
      auto c0 =3D new C;
      auto c1 =3D c0;
 }

 Thank you,
 Ali

c0 and c1 are variables. They are of the type class references, or = references to C. The actual object is an instance of the class C, and is an object. (not = to = be confused with the object class) -- = Simen
Jan 08 2010