@@ -157,28 +157,20 @@ any::~any() {
157157 return (*t)(unthunk);
158158 }
159159
160− auto any::call(const any& a) -> any {
161− assert(a.type == Type::EffFunction || a.type == Type::Function);
162− if (a.type == Type::EffFunction) {
163− return (*a.e)();
164− } else {
165− return (*a.f)(false);
166− }
167− }
168−
169160 auto any::operator()() const -> any {
170− if (type == Type::EffFunction || type == Type::Function) {
171− return call(*this);
161+ if (type == Type::EffFunction) {
162+ return (*e)();
172163 }
173− assert(type == Type::Thunk);
174164 const any* valuePtr = this;
175165 do {
166+ assert(valuePtr->type == Type::Thunk);
176167 const any& value = (*valuePtr->t)(unthunk);
177− if (value.type != Type::Thunk) {
178− return call(value);
168+ if (value.type == Type::EffFunction) {
169+ return (*value.e)();
179170 }
180171 valuePtr = &value;
181− } while (true);
172+ } while (valuePtr->type != Type::Unknown);
173+ return nullptr;
182174 }
183175
184176 any::operator long() const {