开发者

Tcl question - how to list functions in a namespace

开发者 https://www.devze.com 2022-12-31 11:56 出处:网络
I am trying to list all of the functions a namespace has in it (warning - I\'m really new to Tcl, so I\'ll probably use the wrong words for parts of Tcl).For example, I have a tcl shell someone compil

I am trying to list all of the functions a namespace has in it (warning - I'm really new to Tcl, so I'll probably use the wrong words for parts of Tcl). For example, I have a tcl shell someone compiled for me (if that's the right way to phrase it), and I know at least on开发者_JAVA技巧e function exists, let's call it

blah::do_something

I know in ruby there are ways to list all the functions in a module/namespace. How would I find out what other functions are available in the blah namespace in Tcl?

Thanks in advance


You use [info commands] to query what commands are available, and you can scope it to a particular namespace by specifying a glob-style pattern. For example:

% info commands ::blah::*
::blah::do_something


Also: namespace eval ::blah {info procs}

0

精彩评论

暂无评论...
验证码 换一张
取 消