Created
September 13, 2020 08:31
-
-
Save gaufung/03f1eac55a2303121c801191867429f1 to your computer and use it in GitHub Desktop.
Calculator Evaluation Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object.cs | |
public abstract class Object | |
{ | |
public abstract ObjectType Type(); | |
public abstract string Inspect(); | |
} | |
// IntegerObject.cs | |
public class IntegerObject : Object | |
{ | |
public long Value { get; set; } | |
public override string Inspect() | |
{ | |
return $"{Value}"; | |
} | |
public override ObjectType Type() | |
{ | |
return ObjectType.INTEGER; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment