Re: Primitive Type Definition

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Mujtaba Syed (mujtaba_at_marlabs.com)
Date: 01/25/05

  • Next message: Jon Skeet [C# MVP]: "Re: Primitive Type Definition"
    Date: Tue, 25 Jan 2005 14:38:07 -0500
    
    

    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.

    "Ice" <ice@nospam.com> wrote in message
    news:%23uLGcarAFHA.1524@TK2MSFTNGP09.phx.gbl...
    >
    > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
    > news:MPG.1c60007428034b6e98bc6d@msnews.microsoft.com...
    > > Ice <ice@nospam.com> wrote:
    > > > 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.
    > >
    > > 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
    > > If replying to the group, please do not mail me too
    >
    > 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.
    >
    >


  • Next message: Jon Skeet [C# MVP]: "Re: Primitive Type Definition"

    Relevant Pages

    • Re: References and comparisons
      ... So you're saying someone can call themself a Java programmer and not even know "by heart" how to use primitive types and String? ... No matter that, it wasn't important in my point anyway. ...
      (comp.lang.java.help)
    • Re: References and comparisons
      ... Lew wrote: ... So you're saying someone can call themself a Java programmer and not even know "by heart" how to use primitive types and String? ...
      (comp.lang.java.help)
    • Re: Create String from char - so difficult??
      ... The String class has valueOf() overloads for all the ... primitive types. ...
      (comp.lang.java.programmer)
    • Re: StringBuilder much much faster and better than String for concatenation !!!
      ... For each string that you create, the previous string is up for garbage collection. ... never specify anything so I'm OK. ... The primitive types already have methods in the Convert class, so instead of doing Convert.ChangeType) you can use Convert.ToInt32. ... Converting a string to an int is parsing. ...
      (microsoft.public.dotnet.languages.csharp)
    • RE: Overloading SOAP Interpretations for Specific Primitive Types
      ... That example of a "false" is definitely not intuitive, nor XML ... compliant for a boolean value set. ... know to do this is to create a custom Web Service Extension that modifies ... Overloading SOAP Interpretations for Specific Primitive Types ...
      (microsoft.public.dotnet.framework.aspnet.webservices)