public string ToPrintableString() { switch (this.type) { case eeObjectType.LIST: return(this.value == null ? "[]" // Empty list : $"[{string.Join(", ", (from elem in this.AsList() select elem.ToPrintableString()))}]"); case eeObjectType.STRING: return(this.AsString()); case eeObjectType.NUMBER: return(this.AsNumber().ToString()); case eeObjectType.BOOL: return(this.AsBool() ? "true" : "false"); case eeObjectType.FUNCTION: eeFunction func = this.AsFunction(); return($"<function object {func.name}; {func.getArgNames()}>"); case eeObjectType.internal_NONE_OBJ: return("<none>"); default: throw new Exception("default case for ToPrintableString"); } }