#
# alias: an easy way to add proc to the session
#
#   the following variables will be set automatically for you:
#   args: list of all arguments the alias was called with
#   argn: number of arguments
#   arg#: where # is a number from 0 to argn-1 containing
#         the value of the corresponding argument
#
# ex.: 
#   alias gac get all corpse
#   alias ga  { get all $args }
#   alias gb  { get $arg0 from $arg1 }
#   unalias gb
#
::proc _alias {} {
    ::uplevel 1 {
	::set argn [::llength $args]
	::for {::set i 0} {$i<$argn} {::incr i} {
	    ::eval ::set arg$i [::lindex $args $i]
	}
    }
}
::proc alias {name args} {
    ::proc $name {args} "
        _alias
	::eval $args
    "
}
::proc unalias {name} {
    ::rename $name {}
}
