Artifacts Associated With Ticket 558299ffffffffff
Ticket change [582b88eca7] (rid 117757) by lvirden on 2002-05-20 14:46:02:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I would like to request a new feature where by the only valid use of a proc argument called 'args' is as the last argument of the proc. It need not of course be present at all - but if it is present, the change would require args to be the last argument. In this way, changes to proc definitions by non-savvy tcl programmers do not break the Tcl behavior of treating args special if it is the last argument. Also, use of args as a 'normal' proc argument is prevented - otherwise, tcl programmers seeing the variable may expect a list of remaining arguments when in fact they are only getting one argument.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "lvirden"
- subsystem initialized to: "22. [proc] and [uplevel]"
- title initialized to: "restrict use of proc argument named args"
- type initialized to: "RFE"
Ticket change [797e570706] (rid 90142) by dkf on 2002-05-20 21:52:38:
- icomment:
Logged In: YES user_id=79902 Alternative that I thought of: Make args always magical and for it to suck up all args not used elsewhere (particularly thinking about handling of fixed suffixes on commands that take options.) This would make implementing something that looks like, say, [lsearch] easier as you could declare it as [proc foo {args searchTerm list} {...}] - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [68f8b075a5] (rid 103162) by vincentdarley on 2002-05-20 22:24:53:
- icomment:
Logged In: YES user_id=32170 I like Donal's suggestion a lot. Allowing 'args' as a first argument would make it much easier to implement any command that looks like 'cmd ?opts? blah blah'. Given that commands which look like that are the 'Tcl-way', I think it would be a great idea. That would mean we probably want to throw an error for multiple use of 'args' (i.e. proc {args foo args} {...} is an error, but then again _any_ multiple use of the same parameter is most likely an error). My only worry: anyone who has written code using 'args' as a non-final parameter has a reasonable chance that the code might break when this change is made. This represents a mild backwards compatibility issue, but likely only for code written by Tcl-beginners. - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [9d626e072c] (rid 96297) by pspjuth on 2007-02-22 14:42:33:
- icomment:
Logged In: YES user_id=98900 Originator: NO See also TIP 288
- login: "pspjuth"
- mimetype: "text/plain"
- username: "pspjuth"
- icomment:
Ticket change [f5b4b2a02f] (rid 130162) by lvirden on 2007-02-22 19:35:36:
- icomment:
Logged In: YES user_id=15949 Originator: YES hey, I don't mind the idea of args always being special, I guess. It would allow intentional use as Donal described to be done. The original request arose when someone had come along and, not knowing the specialness of args, added an argument after it in a proc, resulting in the code not working. The newly proposed behavior of always being magic is a potential incompatibility, but not any more than my original request...
- login: "lvirden"
- mimetype: "text/plain"
- username: "lvirden"
- icomment:
Ticket change [c73e2d252a] (rid 261540) by serhiy.storchaka on 2026-11-13 11:18:44:
- closedate changed to: "2461357.9713335303"
- closer changed to: "serhiy.storchaka"
- icomment:
The direction agreed on here, making args special anywhere, was TIP 288. That TIP was rejected in 2022, and nobody proposed the incompatible restriction separately.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Rejected"
- status changed to: "Closed"