Skip to content

Instantly share code, notes, and snippets.

@gaufung
Created September 13, 2020 08:31
Show Gist options
  • Save gaufung/03f1eac55a2303121c801191867429f1 to your computer and use it in GitHub Desktop.
Save gaufung/03f1eac55a2303121c801191867429f1 to your computer and use it in GitHub Desktop.
Calculator Evaluation Object
// 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