Skip to content
Tcl Source Code Artifact [298a69d39d]
Login

Artifact [298a69d39d]

Artifact 298a69d39d58c90aa589695618d57f242b7c933b:

Ticket change [298a69d39d] - New ticket [1998221fffffffff|1998221fff] <i>class mixins are in the wrong spot in the callchain</i>. by mpc_janssen on 2008-06-19 20:27:08.
D 2008-06-19T20:27:08
J assignee dkf
J cmimetype text/plain
J comment Executing\sthe\sfollowing\sscript:\n\noo::class\screate\sA\s\s{\n\s\s\s\smethod\sa_with_next\s{}\s{puts\sa_awn\s;\snext}\n\s\s\s\smethod\sa\s{}\s{puts\sa_a}\n}\noo::class\screate\sAM\s{\nmethod\sa_with_next\s{}\s{puts\sam_awn\s;\snext\s}\nmethod\sa\s{}\s{puts\sam_a\s;\snext}\nmethod\sb\s{}\s{puts\sa_b\s;\snext}\n}\n\n\noo::define\sA\smixin\sAM\nA\screate\sa\na\sa\na\sa_with_next\na\sb\n\ngives\sthe\sfollowing\soutput:\n\na_a\na_awn\nam_awn\na_b\n\n\ne.g.\smethods\sin\sthe\sclass\sare\scalled\sbefore\sthe\smethods\sin\sthe\smixin\sclass.\nThis\shas\sseveral\sconsequences:\n\n1)\sIf\sa\sclass\sshould\sbe\sextensible\sby\sa\smixin,\sthe\smethod\sdefined\sin\sthe\sclass\sshould\scall\snext\sto\srun\sthe\sfunctionality\sin\sthe\smixed\sin\smethod.\n2)\sbecause\syou\swill\snot\sknow\sa\spriori\sif\sanyone\swould\sextend\syour\sclass\sin\sthis\sway\syou\swill\shave\sto\send\severy\smethod\swith\sa\scall\sto\snext\n3)\sbecause\sof\s2,\snext\sis\sa\ssilent\snoop\swhen\sno\snext\smethod\sexists.\n\nIf\sthe\scall\schain\sis\schanged\sso\sthat\smixed\sin\smethods\sare\scalled\sfirst:\n\n1)\smethods\swill\snot\sneed\sa\scall\sto\snext\sto\sbe\sextensible\sby\smixins\n2)\sa\snext\swith\sno\snext\smethod\scan\sbecome\san\serror\sagain\s(as\sit\sshould\sbe\sIMO)\n\nAlso\snote\sthat\sthis\swill\sthen\sbe\sconsistent\swith\smixins\son\sobjects,\swhere\sthe\smixed\sin\smethod\s*is*\scalled\sbefore\sthe\smethod\son\sthe\sobject.\s\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter mpc_janssen
J subsystem 35.\sTclOO\sPackage
J title class\smixins\sare\sin\sthe\swrong\sspot\sin\sthe\scallchain
J type Bug
K 1998221fffffffffffffffffffffffffffffffff
U mpc_janssen
Z 6b3cb6e0ffb4343c84df29b8255e1660