Skip to content

Change markers to types #42

Description

@konard

Meaning root should be named just Type or RootType.

var markerIndex = One;
MeaningRoot = links.GetOrCreate(markerIndex, markerIndex);

Each marker is just type "inherited" from root type. So, marker links should be like this: (Object: Type -> Object)

DocumentMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
ObjectMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
MemberMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
ValueMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
StringMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
EmptyStringMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
NumberMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
NegativeNumberMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
ArrayMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
EmptyArrayMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
TrueMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
FalseMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));
NullMarker = links.GetOrCreate(MeaningRoot, Arithmetic.Increment(ref markerIndex));

Each marker can be named just Object or ObjectType instead of "marker".

The basic type system is like this:

Type -> Type
Type -> Value

So everything that comes after Type is Type or Value. Meaning, we can have infinite depth hierarchy of types. The special case of type is a concrete value (constant of some type).

For example, we can have:

(Array: Type -> Array)
(EmptyArray: Array -> EmptyArray)

Meaning that Array is type. And EmptyArray is concrete value (constant) of type Array.

Each value/constant is still type. Each type can be used as a standalone constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions