--- stack/stack.c 2002/02/07 03:56:39 1.46 +++ stack/stack.c 2002/02/07 04:11:10 1.47 @@ -8,6 +8,8 @@ #include /* assert */ #include +/* strcat */ +#include #define HASHTBLSIZE 65536 @@ -406,10 +408,8 @@ push_val(&(env->head), val); /* Return its bound value */ } -extern void pack(environment*); void stack_read(environment*, char*); - /* If the top element is a symbol, determine if it's bound to a function value, and if it is, toss the symbol and execute the function. */ @@ -418,6 +418,7 @@ funcp in_func; value* temp_val; stackitem* iterator; + char* temp_string; if(env->head==NULL) { printerr("Too Few Arguments"); @@ -471,15 +472,15 @@ env->head->item->refcount++; toss(env); if(env->err) return; - push_sym(env, "["); - env->non_eval_flag++; - stack_read(env, (char*)temp_val->content.ptr); - env->non_eval_flag--; - push_sym(env, "["); pack(env); - if(env->err) return; + temp_string= malloc(strlen((char*)temp_val->content.ptr)+5); + strcat(temp_string, "[ "); + strcat(temp_string, (char*)temp_val->content.ptr); + strcat(temp_string, " ]"); + stack_read(env, temp_string); eval(env); if(env->err) return; free_val(temp_val); + free(temp_string); break; default: