home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
pc
/
exsource.old
/
13_2.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
497b
|
27 lines
#
# Example 13-2
# Printing a procedure definition.
#
proc Proc_Show {{namepat *} {file stdout}} {
foreach proc [info procs $namepat] {
set space ""
puts -nonewline $file "proc $proc {"
foreach arg [info args $proc] {
if [info default $proc $arg value] {
puts -nonewline $file "$space{$arg $value}"
} else {
puts -nonewline $file $space$arg
}
set space " "
}
# Double quotes allow substitution
# of [info body $proc]
puts $file "} {[info body $proc]}"
}
}