home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 3
/
Meeting_Pearls_III.iso
/
Pearls
/
dev
/
AmigaE
/
E_v3.2a
/
Src
/
Library
/
Stack
/
stacklib.e
< prev
next >
Wrap
Text File
|
1994-11-08
|
495b
|
27 lines
/* A stack library. uses the stack class. */
LIBRARY 'stack.library',1,1,'bla' IS stack,end,push,pop,isempty
MODULE 'class/stack'
PROC stack() HANDLE
DEF x=NIL:PTR TO stack
NEW x.stack()
EXCEPT DO -> prevent "NEW" exceptions being thrown out of the library
ENDPROC x
PROC end(st:PTR TO stack)
END st
ENDPROC
PROC push(st:PTR TO stack,v) HANDLE
st.push(v)
EXCEPT DO
ENDPROC
PROC pop(st:PTR TO stack) IS st.pop()
PROC isempty(st:PTR TO stack) IS st.is_empty()
PROC main()
ENDPROC