Grok32` DataTypes

DataType

 

A basic Type, type, is an irreducible ExpressionAtom whose Head is a Type[Name], (Type[Name][type] is True), and whose brackets contain a BinaryString, (called its substance), interpreted by Type[type][Function]Grok32` comes with a few basic Types.  They are:

 

{Cardinal, Real, String, Name, Compile}

 

Each of these basic Types have their respective Type[type][Function].  This compiled Function returns a unique Cardinal reference handle to the binary substance of a successfully interpreted Type.  Similarly, any user-defined DataType, type, must includes its own Type[type][Function].  User-defined DataType, are created and compiled using any of the following 16 atoms:

 

{True, Not, Noop,

Cardinal, Real, Compute,

String, Sequence, List, Set,

Pattern, Type, Talley,

Context, Name, Compile}

 

Significantly, an Expression is not a DataType.

The closest thing to an Expression within the DataType lexicon as it is defined above, is a SubstitutionName which can import an Expression�s Branch Structure and attempt to interpret it with the above 16 keyword lexicon.  Grok32`Compile`Type` is the formal ContextName where resides the algorithms that perform these reckonings.  See `Compile`Type` document.

 

True is implemented exactly as defined. See True, Not, Set.

The 16 atoms are assembled as a Pattern to match and thereby specify a DataType.

A DataType specification is essential to define Compile[�]�s input and output.  See CompileContext.

 

 

These are used to define the StructuredTypeDefinitions for any CodeObject input/output specification which is automatically gleaned from the compiled Expression�s source code.  The above 16 word lexicon is used to generate (compile) C DataStructures.

 

Interestingly, C has about 17 reserved words which help define DataTypes

In the following, these 17 words are grouped together by function:

 

StorageClass = {auto, extern, register, static}

C_Function = {sizeof, struct, typedef, union}

C_Types = {char, double, enum, float, int, long, short, union, unsigned, void}

 

 


Grok32`

2004 by John Van Wie Bergamini. All rights reserved.

 

 

C has a few basic data types, they are:

" A character: char

" An integer: int

" A floating point number: float and double

 

There are three modifiers that are commonly applied to some basic data types

" long, which basically doubles the space allocated to int and float/double types.

 

" short, which handles ints up to 32768

(it is less important now that computers have more memory).

 

" unsigned, which is applied to integers and changes their range from [-2^31, 2^31) to [0, 2^32).

 

An unsigned value does not view its left-most bit as a sign, it is part of the value.

 

The type qualifier const is important.

" const qualifies data items that must not alter during execution of the program.

 

I also consider a pointer to be a basic data type - a pointer is always the size of a machiine address and is treated like an unsigned integer.

See King Page 111, for the range of integer values for 32-bit computers.

 

Hosted by www.Geocities.ws

1