From: Bernhard van Woerden on
I'd like to create a command alias and later do some introspection;
firstly I'd like to know if the command is an alias and if so what the
target is but

$ proc foo {} {}
$ interp alias {} bar {} foo

but
$ interp target {} $bar
<empty list>
as per the documentation for TCL 8.5

Does anyone have an alternative way to find the target ?

Thanks
Bernhard
From: Jeff Hobbs on
On Jun 14, 8:46 am, Bernhard van Woerden <bernh...(a)qcode.co.uk> wrote:
> I'd like to create a command alias and later do some introspection;
> firstly I'd like to know if the command is an alias and if so what the
> target is but
>
> $ proc foo {} {}
> $ interp alias {} bar {} foo
>
> but
> $ interp target {} $bar
^^^^^? ^?

> <empty list>
> as per the documentation for TCL 8.5
>
> Does anyone have an alternative way to find the target ?

You have a syntax error or three. This command works as expected.

Jeff
From: Jeff Hobbs on
On Jun 14, 9:55 am, Jeff Hobbs <jeff.ho...(a)gmail.com> wrote:
> On Jun 14, 8:46 am, Bernhard van Woerden <bernh...(a)qcode.co.uk> wrote:> I'd like to create a command alias and later do some introspection;
> > firstly I'd like to know if the command is an alias and if so what the
> > target is but
>
> > $ proc foo {} {}
> > $ interp alias {} bar {} foo
>
> > but
> > $ interp target {} $bar
>
>            ^^^^^?    ^?
>
> > <empty list>
> > as per the documentation for TCL 8.5
>
> > Does anyone have an alternative way to find the target ?
>
> You have a syntax error or three.  This command works as expected.

Actually, I see your confusion (though $bar is still wrong). 'target'
returns "", which is the target interpreter path, and thus the right
response. You want [interp alias {} bar].

Jeff
From: Bernhard van Woerden on
On Jun 14, 5:56 pm, Jeff Hobbs <jeff.ho...(a)gmail.com> wrote:
> On Jun 14, 9:55 am, Jeff Hobbs <jeff.ho...(a)gmail.com> wrote:
>
>
>
>
>
> > On Jun 14, 8:46 am, Bernhard van Woerden <bernh...(a)qcode.co.uk> wrote:> I'd like to create a command alias and later do some introspection;
> > > firstly I'd like to know if the command is an alias and if so what the
> > > target is but
>
> > > $ proc foo {} {}
> > > $ interp alias {} bar {} foo
>
> > > but
> > > $ interp target {} $bar
>
> >            ^^^^^?    ^?
>
> > > <empty list>
> > > as per the documentation for TCL 8.5
>
> > > Does anyone have an alternative way to find the target ?
>
> > You have a syntax error or three.  This command works as expected.
>
> Actually, I see your confusion (though $bar is still wrong).  'target'
> returns "", which is the target interpreter path, and thus the right
> response.  You want [interp alias {} bar].
>
> Jeff

Brill , thanks Jeff.
Sorry for the typo on $bar

Yeah [interp alias {} bar] returns foo .. just what I need.

Thank you very much.

Bernhard