Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-05-16
19:56 • Ticket [719454ffff] Provide better alias introspection status still Open wit... artifact: 10506b783d user: mic42
19:55 • Ticket [719454ffff]: 4 changes artifact: 9caa32db73 user: mic42
2003-04-11
04:02 • New ticket [719454ffff]. artifact: b3433b01f4 user: mic42

Provide better alias introspection

Open719454ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-04-11 04:02:03
interp alias is a mighty tool, but lacks introspection
capabilities that exists for procs.

info args
info default

work only for procs, not for aliases to procs.

Example of the problem:

proc foo {a b c d e} {
      puts "Hello"
}

% interp create a
% interp alias a fooz {} foo
fooz
% interp eval a fooz
wrong # args: should be "foo a b c d e"
% interp eval a info args fooz
"fooz" isn't a procedure
% interp alias a fooz
foo

This makes it impossible for slave interpreters to
discover the correct number of arguments from an alias
other than by error or by asking their masters for help. 

It would be really nice if at least the [info args] and
[info default] commands would work for aliased procs,
probably accounting for the change in the parameters
list possible with interp alias.

One example where this would be useful is for
tclhttpd's Direct_Url system that tries to detect
arguments by [info args] which fails for aliased in procs.
mic42plain2003-05-16 19:55:17
Logged In: YES 
user_id=302287

The wiki now has some code for this:
http://mini.net/tcl/8766

Builtin would be nicer though.
mic42 Ticket [719454ffff]: 1 change [History diff]2003-05-16 19:56:49
Log in (anonymous is fine) to add a comment.