class stack {
    variable list {}
    method push { element } {lappend list $element}
    method pop {} {
        set tmp [lindex $list end]
        set list [lreplace $list end end]
        return $tmp
    }
    method clear {} { set list {} }
}
 
      
