Re: Struct a lightweight class type having value based semantics?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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".

.



Relevant Pages

  • Re: Interesting list Validity (True/False)
    ... different string types, never compare equal; ... Why should the int 1 return True when compared to mpz? ... of shoes is not the same as a box of shoes, even if they are the same ... numeric types, so the earlier rule applies: ...
    (comp.lang.python)
  • Re: The smallest and largest values of numeric types
    ... Lou Pecora wrote: ... How can I determine the smallest and largest values of numeric types ... (for example int) ... "I have come to believe that the whole world is an enigma, a harmless enigma ...
    (comp.lang.python)
  • Re: Integer sizes
    ... I work with a C compiler for which, by default, int is 8 bits. ... and all this incomprehensible crap. ... where they define numeric types more inteligently, ... typing (keyboard typing I mean), and to play along with existing code. ...
    (comp.lang.cpp)
  • Re: The smallest and largest values of numeric types
    ... of numeric types (for example int) possible in my ... For floats, ... # Determine max binary digits for float on this system. ...
    (comp.lang.python)