enhancement for namespace ensemble usage reporting
Open1773103fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 11 years ago
Descriptionplain2007-08-13 14:04:17
If an namespace ensemble command is invoked without a subcommand the normal Tcl_WrongNumArgs message is called. For Itcl I would need to do a different reporting. It would work if at the beginning if aan unknown handler exists that would be called instead:
if (objc < 2) {
+ if (ensemblePtr->unknownHandler != NULL) {
+ goto unknownOrAmbiguousSubcommand;
+ }
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?argument ...?");
return TCL_ERROR;
}
msofer Ticket [1773103fff]: 1 change
[History diff]2007-08-13 21:13:02
dkfplain2007-12-30 22:40:08
Logged In: YES user_id=79902 Originator: NO I'm more likely to do this as an extra flag bit
wiedeplain2008-01-19 00:40:34
Logged In: YES user_id=558925 Originator: YES An extra flag would be fine with me. Are there any plans already if/when to add such a flag?
dkfplain2008-01-21 22:02:00
Logged In: YES user_id=79902 Originator: NO I've no plans on this one way or the other at the moment.
wiedeplain2008-02-11 01:49:57
Logged In: YES user_id=558925 Originator: YES Having spent some thoughts again on the problem, I think a good solution would be if I could get something like an ensemble "wrongNumArgs" handler similar to the ensemble unknown handler which should be settable via an option.
dkf Ticket [1773103fff]: 2 changes
[History diff]2009-07-14 17:54:44
dkfplain2009-07-27 01:28:29
Update: it would have been nice to have had this when reworking [history] as an ensemble. I found a (horrific) workaround, but this would have been far more elegant.
dkfplain2009-07-27 01:28:57
Update: it would have been nice to have had this when reworking [history] as an ensemble. I found a (horrific) workaround, but this would have been far more elegant.
dkfplain2012-05-26 20:16:49
IP - Comment Removed: 82.42.214.208
nijtmansplain2012-09-14 15:39:37
Ping! Is this still being considered?
dkfplain2012-09-14 15:56:51
It might actually be done as part of TIP #380.
dkfplain2012-09-14 15:59:39
Oops, that was just for TclOO, not [namespace ensemble].
dgpplain2015-07-20 15:53:44
I'm coding an Itcl workaround for this, but sending missing subcommand errors to the unknown dispatcher would be a much better idea. It appears to be specced to handle that case.
Log in (anonymous is fine) to add a comment.