[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jul 20 08:18:30 1993 
Subject:Re: Stacks 
From:jonr (Jonathan Rowe) 
Volume-ID:930720.03 


I had thought of something similar to Anthony Worrall's suggestion,
without changing the stack's current structure:

    PUSH item       item:: STACK -> STACK

    POP             [] -> stackmarks;
                    while (dest(STACK)-> STACK ->> item) == popstackmark do
                        item :: stackmarks -> stackmarks
                    endwhile;
                    stackmarks <> STACK -> STACK;
                    return item;
                    ;;; plus stack underflow checking

Jon Rowe