Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Reflection-Get-source/Tcl/reflection-get-source-1.tcl
Normal file
15
Task/Reflection-Get-source/Tcl/reflection-get-source-1.tcl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
proc getproc {name} {
|
||||
set name [uplevel 1 [list namespace which -command $name]]
|
||||
set args [info args $name]
|
||||
set args [lmap arg $args { ;# handle default arguments, if it has them!
|
||||
if {[info default $name $arg default]} {
|
||||
list $name $default
|
||||
} else {
|
||||
return -level 0 $arg
|
||||
}
|
||||
}]
|
||||
set body [info body $name]
|
||||
list proc $name $args $body
|
||||
}
|
||||
|
||||
puts [getproc getproc]
|
||||
13
Task/Reflection-Get-source/Tcl/reflection-get-source-2.tcl
Normal file
13
Task/Reflection-Get-source/Tcl/reflection-get-source-2.tcl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
proc ::getproc name {
|
||||
set name [uplevel 1 [list namespace which -command $name]]
|
||||
set args [info args $name]
|
||||
set args [lmap arg $args { ;# handle default arguments, if it has them!
|
||||
if {[info default $name $arg default]} {
|
||||
list $name $default
|
||||
} else {
|
||||
return -level 0 $arg
|
||||
}
|
||||
}]
|
||||
set body [info body $name]
|
||||
list proc $name $args $body
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue