* Boston, MA 02111-1307, USA.
*/
#include <iostream>
-#include <queue>
+#include <vector>
#include <string>
#include <cctype>
#include <cstdlib>
/** We have to use this iterative code, because the recursive function
* produces a stack overflow and crashs on OSX 10.2
*/
- std::queue<lisp_object_t*> objs;
- objs.push(obj);
+ std::vector<lisp_object_t*> objs;
+ objs.push_back(obj);
while(!objs.empty()) {
- lisp_object_t* obj = objs.front();
- objs.pop();
+ lisp_object_t* obj = objs.back();
+ objs.pop_back();
switch (obj->type) {
case LISP_TYPE_INTERNAL :
case LISP_TYPE_CONS :
case LISP_TYPE_PATTERN_CONS :
if(obj->v.cons.car)
- objs.push(obj->v.cons.car);
+ objs.push_back(obj->v.cons.car);
if(obj->v.cons.cdr)
- objs.push(obj->v.cons.cdr);
+ objs.push_back(obj->v.cons.cdr);
break;
case LISP_TYPE_PATTERN_VAR :
if(obj->v.pattern.sub)
- objs.push(obj->v.pattern.sub);
+ objs.push_back(obj->v.pattern.sub);
break;
}