Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change markers to types #42

Open
Konard opened this issue Apr 7, 2022 · 0 comments
Open

Change markers to types #42

Konard opened this issue Apr 7, 2022 · 0 comments
Labels
C# help wanted Extra attention is needed

Comments

@Konard
Copy link
Member

Konard commented Apr 7, 2022

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.

@FreePhoenix888 FreePhoenix888 added help wanted Extra attention is needed C# labels Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants