all groups > dotnet clr > january 2005 >
You're in the

dotnet clr

group:

Primitive Type Definition


Primitive Type Definition Ice
1/25/2005 1:07:53 AM
dotnet clr:
All -

Up till now (at least in my opinion) the definition of a primitive type has
been at a language level. You can refer to this definition on msdn at
ms-help://MS.NETFrameworkSDKv1.1/vblsnet/html/vblrfVBSpec6_2.htm

However, in reading Jeffrey Richters book (Applied Microsoft .NET Framework
Programming), he mentions the term "CLR primitive values" and illustrates
that at the "CLR level", Decimal is not a primitive type.

I guess my question is: At what level do we make the decision as to whether
a type is a "primitive type"? At both the language and CLR level? Is there
another name/term/defintion for "types" that have specific IL instructions
that manipulate their values?

I'm interested to know what people's opinions are.

Thanks.

ice

Re: Primitive Type Definition Ice
1/25/2005 3:19:34 AM

[quoted text, click to view]

Yeah, just saw that in the C# language specification although the VB
specification uses "primitive" type. You would think that it would be
consistent. Books also use "primitive" type.

Re: Primitive Type Definition Jon Skeet [C# MVP]
1/25/2005 7:07:02 AM
[quoted text, click to view]

C# defines simple types but not primitive types. (It mentions
"primitive" types, but always in quotes as a sort of "you know what I
mean here" rather than defining them.) I think the CLR level is really
the one it makes sense to define primitive types at.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Re: Primitive Type Definition Mujtaba Syed
1/25/2005 2:38:07 PM
CLR types can be bifurcated as value types and reference types. Primitive
types are some commonly used types like Int32, Single, String, and Boolean
are primitive types. These types generally have aliases defined in
languages. All primitive types except string are value types.

Mujtaba.


[quoted text, click to view]

Re: Primitive Type Definition Jon Skeet [C# MVP]
1/25/2005 8:14:24 PM
[quoted text, click to view]

Actually, String isn't a primitive type. From MSDN:

<quote>
The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32,
UInt32, Int64, UInt64, Char, Double, and Single.
</quote>

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Re: Primitive Type Definition Ice
1/26/2005 10:52:22 AM
so do you consider "decimal" to be a primitive?
[quoted text, click to view]

Re: Primitive Type Definition Jon Skeet [C# MVP]
1/26/2005 5:20:05 PM
[quoted text, click to view]

No - nor is DateTime, which is probably the next most commonly used
value type after the primitives.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Re: Primitive Type Definition Ice
1/27/2005 12:00:36 AM
so the documentation is wrong or misleading.
eb
[quoted text, click to view]

Re: Primitive Type Definition Jon Skeet [C# MVP]
1/27/2005 7:24:58 AM
[quoted text, click to view]

Well, it just means that the VB.NET idea of a primitive type isn't the
same as the CLR's idea of a primitive type.

That's somewhat confusing, but may well be historical.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Re: Primitive Type Definition Abubakar
2/14/2005 11:48:19 AM
Dim t As Type = GetType(String)
Console.WriteLine("primtive {0}.", t.IsPrimitive)

will display False.

Ab.

[quoted text, click to view]

Re: Primitive Type Definition Abubakar
2/14/2005 11:50:40 AM

[quoted text, click to view]

u can check it with following code:

Dim t As Type = GetType(Decimal)
Console.WriteLine("primtive {0}.", t.IsPrimitive)

It'll return false for decimal.

Ab.



AddThis Social Bookmark Button