|
2008-05-11
| ||
| 17:12 | • Closed ticket [1959483fff]: magic empty body misfeature plus 7 other changes artifact: 7c4c836839 user: dkf | |
|
2008-05-08
| ||
| 22:37 | • Ticket [1959483fff]: 4 changes artifact: abc49e370c user: dkf | |
| 22:20 | • Ticket [1959483fff]: 1 change artifact: 32ff5f8042 user: dkf | |
|
2008-05-07
| ||
| 12:45 | • New ticket [1959483fff]. artifact: 4cbc9169d3 user: dgp | |
magic empty body misfeature
Closed / Accepted1959483fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-05-07 12:45:18
As mentioned before:
http://aspn.activestate.com/ASPN/Mail/Message/tcl-core/3316773
% namespace path oo
% object create foo
::foo
% define foo method x {} {}
% foo x
unknown method "x": must be destroy
Contrast with:
% define foo method w {} {#}
% foo w
%
This is a repeat of the misfeature of
[bind] to give magic treatment to
a perfectly valid body value -- the
empty string. It's analogous to the
[rename $cmd {}] misfeature that similarly
abuses a perfectly valid command name.
I'd prefer an [undefine] command to
destroy method definitions, analogous
to the [unset] command, where we've
properly not given magic unsetting
properties to [set v {}].
dkf Ticket [1959483fff]: 1 change
[History diff]2008-05-08 22:20:46
dkfplain2008-05-08 22:37:20
Logged In: YES user_id=79902 Originator: NO I think this is a valid point of view.
dkfplain2008-05-11 17:12:38
Logged In: YES user_id=79902 Originator: NO Implemented a 'deletemethod' subcommand of oo::define and oo::objdefine. Also done a 'renamemethod'.
Log in (anonymous is fine) to add a comment.