proc tes args {
  if {[llength $args]>0} {puts [lindex $args 1]}
}

proc : args { m1 $args }
proc = args { expr "$args" }
if {[llength [info command p]]==0} { proc p "" {source pro1} }
proc s file { eval "uplevel {source $file}" }

proc do {i s e args} { 
  if {[llength $args]>1} { set in [m1 $args]; set com [m2 $args]
     } else { set in ""; set com $args; }
  eval "uplevel {for {set $i $s} {
        $$i<=$e} {incr $i $in} { eval $com }}"
}
proc type c {puts "\n$c [info args $c] { [info body $c] }\n"}

proc EQ {s t} {if [string comp $s $t] {: 0} else {: 1}}
proc lshift list { lrange $list 1 end }
proc m1 list { lindex $list 0 }
proc m2 list { lindex $list 1 }
proc m3 list { lindex $list 2 }


proc tx {w wd ht args} { if {[llength $w]>1} { set opt "" } else {set opt "-bg azure"}
  set na [eval text $w $opt -relief raised\
  -font 9x15bold -border 2 -width $wd -height $ht -wrap none]
  if {[llength $args]} {eval "uplevel {set [m1 $args] $na}"} else {set na}}
proc dtx args { foreach w $args { $w delete 1.0 end} }
proc ptx {w t} { $w insert 1.0 $t }
proc dptx {w t} { dtx $w; ptx $w $t }
proc ntx args { foreach w $args { $w conf -st disabled } }
proc gtx {w args} { set na "{[$w get 1.0 end]}"
  if {[llength $args]} { eval "uplevel {set [m1 $args] $na}" }
  eval : $na }

proc bn {w t c} {
  button $w -text " $t  " -font 9x15bold -bg pink -com $c}

proc pk {pos w args} { 
  if [ EQ $w . ] {set pw ""} else { set pw $w }
  foreach i $args { set p $pos
    if {[llength $i]==1} {set c $i; } else {
        set c [m1 $i]; append p " [lshift $i]" }
    pack append $w $pw.$c $p } }
proc pcol  args { eval "pk top    $args" }
proc pcolb args { eval "pk bottom $args" }
proc prow  args { eval "pk left   $args" }
proc prowr args { eval "pk right  $args" }

proc xch {args} { if {[llength $args]} {set w [m1 $args]} else {set w .}
  foreach i [winfo child $w] {destroy $i} }
