From: Jan N. <nij...@us...> - 2008-07-18 12:30:52
|
8 days ago, I started this thread and 3 people reacted. First of all, a big thanks! It clearified a lot to me. Then the result. Michael Kirkham came to the following conclusion: > So, IMHO, this would be most correct and specific for procs: > > % proc foo {a b c args} something > % foo x > wrong # args: should be "foo a b c ?arg ...?" and he gave a lot of pro's and contra's for each of the variations. This variant was not in my list, but it actually is used in a lot of places in Tcl, e.g.: % encoding wrong # args: should be "encoding option ?arg ...?" % interp wrong # args: should be "interp cmd ?arg ...?" % namespace wrong # args: should be "namespace subcommand ?arg ...?" I have to agree with him, and with the other arguments given. So, therefore I would like to declare this as the winner!!!! 2008/7/10 Donal K. Fellows <don...@ma...>: > Lars Hellström wrote: >> Whatever is chosen, the choice should be documented -- if not in a > I disagree. We've never ever documented the format of syntax errors. Documenting this has the disadvantage that we have to stick with it and that we should take care that the Tcl core follows the documentation. 2008/7/10 Donal K. Fellows <don...@ma...>: > Lars Hellström wrote: >> Here namespace, ensemble, and configure are actual arguments, whereas >> cmdname, opt, and value are formal arguments. This distinction could perhaps >> be shown somehow. > > I disagree again. Mostly because it's awkward to render things in bold and > italics without getting into other problems. "Check the manual page if > you're confused, guys!" :-) I suppose we could do tricks like > b^Hbo^Hol^Hld^HD or i^H_t^H_a^H_l^H_i^H_c^H_s^H_ but that's *really* ugly > when it goes wrong or if you're trying to handle it with scripts. I don't want to add any more than consistancy, that's already work enough. The reason I came up with this, is that I wrote a small proc in which the second argument was a kind of subcommand, handled by a "switch". Later I rewrote it using namespace ensemble, and noticed that the error-messages changed. I created a new ticket: [ 2021443 ] inconsistant "wrong # args" messages in which I copied the messages in this thread. Now it is documented ;-) Regards, Jan Nijtmans |