Share

Tcl

Tracker: Patches

5 new [info] subcommand: formalargs - ID: 461635
Last Update: Comment added ( dgp )

[info args procname] does not return any default values.

One must resort to iterating over the results from [info args], calling
[info default] for each one, and build up a list.

It would be more convenient to have an [info] subcommand in the core that
accomplishes that feat.

I propose [info fullargs procname]:

proc t1 [list one [list two ""] args] {}
info fullargs t1 ;# ==> one {two {}} args


Glenn Jackman ( glennjnn ) - 2001-09-14 19:17

5

Closed

Rejected

Don Porter

17. Commands I-L

None

Public


Comments ( 5 )

Date: 2003-04-11 16:21
Sender: dgpProject Admin

Logged In: YES
user_id=80530

TIP 65 rejected.


Date: 2003-03-21 05:05
Sender: dgpProject Admin

Logged In: YES
user_id=80530

combined changes into one patch

updated patch to HEAD

corrected test numbering (tests should keep
the same ID over Tcl history)

Changed to [info formalargs] as last TIPped.


Date: 2001-09-17 10:33
Sender: dkfProject Admin

Logged In: YES
user_id=79902

Why do you think I said it needed a TIP? :^)


Date: 2001-09-17 10:18
Sender: nobody

Logged In: NO

I might suggest 'info args -withdefaults'. If we only
examine the option when there is a 4th argument, there are
also no backwards compatibility issues with the unlikely
possibility of a proc called '-withdefaults'. -- Vince.


Date: 2001-09-17 09:33
Sender: dkfProject Admin

Logged In: YES
user_id=79902

This feature *requires* a TIP; I'm not too sure if I like
the name 'fullargs' either... :^)

Implementation looks technically OK though.


Attached Files ( 4 )

Filename Description Download
info.n.diff context diff of doc/info.n Download
info.test.diff context diff of tests/info.test Download
tclCmdIL.diff context diff of generic/tclCmdIL.c Download
461635.patch Download

Changes ( 15 )

Field Old Value Date By
status_id Open 2003-04-11 16:21 dgp
close_date 2002-08-30 18:27 2003-04-11 16:21 dgp
resolution_id None 2003-04-11 16:21 dgp
File Added 45592: 461635.patch 2003-03-21 05:05 dgp
summary new [info] subcommand: fullargs 2003-03-21 05:05 dgp
status_id Closed 2003-03-19 23:33 dgp
assigned_to dkf 2003-03-19 23:33 dgp
close_date 2001-09-17 09:33 2002-08-30 18:27 glennjnn
status_id Open 2002-08-30 18:27 glennjnn
status_id Pending 2001-09-17 10:33 dkf
close_date - 2001-09-17 09:33 dkf
status_id Open 2001-09-17 09:33 dkf
File Added 10800: info.test.diff 2001-09-14 19:24 glennjnn
File Added 10799: info.n.diff 2001-09-14 19:23 glennjnn
File Added 10798: tclCmdIL.diff 2001-09-14 19:21 glennjnn