Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Single command for all kind of introspection

37 views
Skip to first unread message

pd

unread,
Feb 8, 2018, 5:18:13 AM2/8/18
to
Currently introspection information is scattered across several commands (info, package...)

I think it would be better if all info being accessed through a central command for example info

Making a central info command is very appealing (for me at least) but very inflexible due to being a monolithic command hard to maintain

But probably something in the "right" direction can be done...

Making a new command which is a facade interface to the plethora of introspection commands, this new command simply delegates to other specialised (current) commands to get the information

This way you have a central command, a one and only common place for user gathering information and also you can easily refactor when ever you want without affecting users and existent code. This is good because you can deprecate a command (like info) or even replace or remove it without a problem and you always offer the same interface to users

What do you think?

(I know you can always define such a proc in user land but what I'm proposing is that being the official way of introspection in tcl and maybe implemented in a high performance way in core)

Donal K. Fellows

unread,
Feb 8, 2018, 5:33:42 AM2/8/18
to
On 08/02/2018 10:18, pd wrote:
> Making a central info command is very appealing (for me at least) but very inflexible due to being a monolithic command hard to maintain

The [info] command is an ensemble. You can plug subcommands into it (it
uses an explicit map for reasons of bytecode-compile-ability, so you
need to update that instead of just throwing the subcommand into a
namespace).

Donal.
--
Donal Fellows — Tcl user, Tcl maintainer, TIP editor.
0 new messages