View · Index

Use Stack

% package req XOTcl
% namespace import xotcl::*
% source stack.xotcl
  
# Create Object s1 of class Stack
% Stack s1
::s1
% s1 push a
a
% s1 push b
b
% s1 push c
c
% s1 pop
c
% s1 pop
b
# Delete object s1
s1 destroy