Re: Struct a lightweight class type having value based semantics?
- From: "Greg Graham" <gsg927@xxxxxxxxx>
- Date: 9 Dec 2006 05:55:58 -0800
Gary,
I think you are getting very close, but don't worry that this is
difficult for you. Computer scientists have worked on defining type
semantics for decades.
garyusenet@xxxxxxxxx wrote:
There are five different types available in C# class, structure,
interface, enumeration, delegate. Each of these types is of a certain
sort. Either value based, or reference based.
If it is value based the type directly contains its value, if it is
reference based it does not contain it's value, but instead refers to
that part of computer memory that contains its value.
Please tell me the above paragraph is sound?
(i'm still a bit confused about about native types like int etc.. i
don't quite see how they fit into the picture)
I think I would make a small change to your paragraph and say "There
are five different kinds of user definable types". As another poster
said, there are lots of types, so these five categories are kinds of
types. A sixth kind of type is "numeric", and include int, float,
double, etc. However, numeric types are built in to the language, and
users of the language cannot define new numeric types. They are also
value types, so as far as how they are stored and passed as parameters,
numeric types like int and float behave like single field structs.
Finally, bools would be a predefined enumeration that has special
meaning to control statements like "if" and "while".
.
- References:
- Struct a lightweight class type having value based semantics?
- From: garyusenet
- Re: Struct a lightweight class type having value based semantics?
- From: Jon Skeet [C# MVP]
- Re: Struct a lightweight class type having value based semantics?
- From: garyusenet
- Struct a lightweight class type having value based semantics?
- Prev by Date: Re: Get list of the Groups a User belongs to
- Next by Date: Re: can an owner of a window be changed?
- Previous by thread: Re: Struct a lightweight class type having value based semantics?
- Next by thread: Re: how to get the port number of "Default Web Site" from IIS
- Index(es):
Relevant Pages
|