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

Diff of /stack/stack.c

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

revision 1.113 by teddy, Sun Mar 17 00:55:58 2002 UTC revision 1.114 by teddy, Sun Mar 17 02:15:01 2002 UTC
# Line 233  extern void gc_init(environment *env) Line 233  extern void gc_init(environment *env)
233      /* Keep values */          /* Keep values */    
234      env->gc_count += sizeof(value);      env->gc_count += sizeof(value);
235      if(env->gc_ref->item->type==string)      if(env->gc_ref->item->type==string)
236        env->gc_count += strlen(env->gc_ref->item->content.ptr);        env->gc_count += strlen(env->gc_ref->item->content.ptr)+1;
237            
238      titem= env->gc_ref->next;      titem= env->gc_ref->next;
239      env->gc_ref->next= new_head;      env->gc_ref->next= new_head;
# Line 484  extern void type(environment *env) Line 484  extern void type(environment *env)
484    toss(env);    toss(env);
485  }      }    
486    
487  /* Prints the top element of the stack. */  /* Print a value */
488  void print_val(value *val, int noquote)  void print_val(value *val, int noquote)
489  {  {
490    switch(val->type) {    switch(val->type) {
# Line 513  void print_val(value *val, int noquote) Line 513  void print_val(value *val, int noquote)
513      printf("[ ");      printf("[ ");
514      do {      do {
515        print_val(CAR(val), noquote);        print_val(CAR(val), noquote);
516        switch(CDR(val)->type){        val= CDR(val);
517          switch(val->type){
518        case empty:        case empty:
519          break;          break;
520        case tcons:        case tcons:
# Line 521  void print_val(value *val, int noquote) Line 522  void print_val(value *val, int noquote)
522          break;          break;
523        default:        default:
524          printf(" . ");          /* Improper list */          printf(" . ");          /* Improper list */
525          print_val(CDR(val), noquote);          print_val(val, noquote);
526        }        }
       val= CDR(val);  
527      } while(val->type == tcons);      } while(val->type == tcons);
528      printf(" ]");      printf(" ]");
529      break;      break;
# Line 1725  extern void sx_72656164(environment *env Line 1725  extern void sx_72656164(environment *env
1725      } else {      } else {
1726        push_float(env, ftemp);        push_float(env, ftemp);
1727      }      }
1728      } else if(sscanf(env->in_string, "\"\"%n", &readlength) != EOF
1729                && readlength != -1) {
1730        push_cstring(env, "");
1731    } else if(sscanf(env->in_string, strform, match, &readlength) != EOF    } else if(sscanf(env->in_string, strform, match, &readlength) != EOF
1732              && readlength != -1) {              && readlength != -1) {
1733      push_cstring(env, match);      push_cstring(env, match);

Legend:
Removed from v.1.113  
changed lines
  Added in v.1.114

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26