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

Diff of /stack/stack.c

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

revision 1.30 by teddy, Tue Feb 5 12:33:21 2002 UTC revision 1.32 by masse, Tue Feb 5 22:28:04 2002 UTC
# Line 348  stackitem* copy(stackitem* in_item) Line 348  stackitem* copy(stackitem* in_item)
348    return out_item;    return out_item;
349  }  }
350    
351    extern void rcl(environment *env)
352    {
353      value *val;
354    
355      if(env->head == NULL) {
356        printerr("Stack empty");
357        return;
358      }
359    
360      if(env->head->item->type!=symb) {
361        printerr("Not a symbol");
362        return;
363      }
364      val=((symbol *)(env->head->item->content.ptr))->val;
365      toss(env);            /* toss the symbol */
366      push_val(&(env->head), val); /* Return its bound value */
367    }
368    
369  /* 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
370     function value, and if it is, toss the symbol and execute the     function value, and if it is, toss the symbol and execute the
# Line 621  extern void clear(environment *env) Line 638  extern void clear(environment *env)
638      toss(env);      toss(env);
639  }  }
640    
641    extern void words(environment *env)
642    {
643      symbol *temp;
644      int i;
645      
646      for(i= 0; i<HASHTBLSIZE; i++) {
647        temp= env->symbols[i];
648        while(temp!=NULL) {
649          printf("%s\n", temp->id);
650          temp= temp->next;
651        }
652      }
653    }
654    
655  int main()  int main()
656  {  {
657    environment myenv;    environment myenv;

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.32

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26