/[cvs]/stack/stack.c
ViewVC logotype

Diff of /stack/stack.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.46 by masse, Thu Feb 7 03:56:39 2002 UTC revision 1.47 by masse, Thu Feb 7 04:11:10 2002 UTC
# Line 8  Line 8 
8  #include <dlfcn.h>  #include <dlfcn.h>
9  /* assert */  /* assert */
10  #include <assert.h>  #include <assert.h>
11    /* strcat */
12    #include <string.h>
13    
14  #define HASHTBLSIZE 65536  #define HASHTBLSIZE 65536
15    
# Line 406  extern void rcl(environment *env) Line 408  extern void rcl(environment *env)
408    push_val(&(env->head), val); /* Return its bound value */    push_val(&(env->head), val); /* Return its bound value */
409  }  }
410    
 extern void pack(environment*);  
411  void stack_read(environment*, char*);  void stack_read(environment*, char*);
412    
   
413  /* If the top element is a symbol, determine if it's bound to a  /* If the top element is a symbol, determine if it's bound to a
414     function value, and if it is, toss the symbol and execute the     function value, and if it is, toss the symbol and execute the
415     function. */     function. */
# Line 418  extern void eval(environment *env) Line 418  extern void eval(environment *env)
418    funcp in_func;    funcp in_func;
419    value* temp_val;    value* temp_val;
420    stackitem* iterator;    stackitem* iterator;
421      char* temp_string;
422    
423    if(env->head==NULL) {    if(env->head==NULL) {
424      printerr("Too Few Arguments");      printerr("Too Few Arguments");
# Line 471  extern void eval(environment *env) Line 472  extern void eval(environment *env)
472      env->head->item->refcount++;      env->head->item->refcount++;
473      toss(env);      toss(env);
474      if(env->err) return;      if(env->err) return;
475      push_sym(env, "[");      temp_string= malloc(strlen((char*)temp_val->content.ptr)+5);
476      env->non_eval_flag++;      strcat(temp_string, "[ ");
477      stack_read(env, (char*)temp_val->content.ptr);      strcat(temp_string, (char*)temp_val->content.ptr);
478      env->non_eval_flag--;      strcat(temp_string, " ]");
479      push_sym(env, "["); pack(env);      stack_read(env, temp_string);
     if(env->err) return;  
480      eval(env);      eval(env);
481      if(env->err) return;      if(env->err) return;
482      free_val(temp_val);      free_val(temp_val);
483        free(temp_string);
484      break;      break;
485    
486    default:    default:

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26