with stackpkg;
with stackpkg.more;
with ada.text_io; use ada.text_io;
with ada.integer_text_io; use ada.integer_text_io;
procedure trystack is
package intstack is new stackpkg(100, Integer);
use intstack;
-- Notice that we are instantiating intstack.more,
-- not stackpkg.more
package intstackmore is new intstack.more;
use intstackmore;
s: intstack.stack;
begin
push(10, s);
push(20, s);
put_line(size(s)'img); -- 2
put_line(second(s)'img); -- 10
pop(s);
put_line(size(s)'img); -- 1
-- put_line(second(s)'img); -- 10
-- Will raise exception since no second element
end trystack;