public object GetValueOfType(ValueType t) { // Return value of the specified type, or throw error switch (t) { case ValueType.INT: return(IntStack.PopButNoPop() as object); case ValueType.ACTOR: return(ActorStack.PopButNoPop() as object); default: throw new System.ArgumentException("Non-existant valuetype", "t"); } }