.
D 2013-03-05T16:24:23
J assignee dkf
J cmimetype text/plain
J comment The\smethod\schain\sorder\sis\sdocumented\sin\sthe\s'next'\sman\spage\sas:\n\n---\nWhen\sconstructing\sthe\smethod\schain,\smethod\simplementations\sare\ssearched\sfor\sin\sthe\sfollowing\sorder:\nIn\sthe\sobject.\nIn\sthe\sclasses\smixed\sinto\sthe\sobject,\sin\sclass\straversal\sorder.\sThe\slist\sof\smixins\sis\schecked\sin\snatural\sorder.\nIn\sthe\sclasses\smixed\sinto\sthe\sclasses\sof\sthe\sobject,\swith\ssources\sof\smixing\sin\sbeing\ssearched\sin\sclass\straversal\sorder.\sWithin\seach\sclass,\sthe\slist\sof\smixins\sis\sprocessed\sin\snatural\sorder.\nIn\sthe\sobject's\sclass.\nIn\sthe\ssuperclasses\sof\sthe\sclass,\sfollowing\seach\ssuperclass\sin\sa\sdepth-first\sfashion\sin\sthe\snatural\sorder\sof\sthe\ssuperclass\slist.\nAny\sparticular\smethod\simplementation\salways\scomes\sas\slate\sin\sthe\sresulting\slist\sof\simplementations\sas\spossible.\n---\n\nThe\sfollowing\scode\sappears\sto\scontradict\sthe\sdocumentation:\n\n---\noo::define\soo::class\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\noo::define\soo::object\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\noo::class\screate\sSuperObjMix\s{\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\noo::class\screate\sObjMix\s{\ssuperclass\sSuperObjMix\s;\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\noo::class\screate\sClsMix\s{\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\s\s\s\noo::class\screate\sSuperMix\s{\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\noo::class\screate\sMix\s{\ssuperclass\sSuperMix\s;\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\noo::class\screate\sSuper\s{\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\noo::class\screate\sOtherSuper\s{\smixin\sMix\s;\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\noo::class\screate\sMyClass\s{\smixin\sClsMix\s;\ssuperclass\sSuper\sOtherSuper;\smethod\sm\s{}\s{\sputs\s[self\sclass];\snext\s}\s}\nMyClass\screate\smyclass\noo::objdefine\smyclass\smixin\sObjMix\s\noo::objdefine\smyclass\smethod\sm\s{}\s{\sputs\s[self];\snext\s}\nmyclass\sm\n---\n\nOutput:\n---\n::ObjMix\n::SuperObjMix\n::myclass\n::ClsMix\n::MyClass\n::Super\n::Mix\n::SuperMix\n::OtherSuper\n::oo::object\nno\snext\smethod\simplementation\n---\n\nI\shaven't\schecked\sthe\sTcl\scode,\sbut\sthe\smethod\schain\sappears\sto\sbe\sbetter\sdescribed\sas\sfollows:\n\n---\n\s\s\s\s#\s-\sIn\sthe\sclasses\smixed\sinto\sthe\sobject.\s\sThe\slist\sof\smixins\sis\schecked\n\s\s\s\s#\s\s\sin\snatural\sorder;\seach\smixin\s(and\sits\smixins\sand\ssuperclasses)\sis\s\n\s\s\s\s#\s\s\schecked\sin\sclass\straversal\sorder.\n\s\s\s\s#\s-\sIn\sthe\sobject\sitself.\n\s\s\s\s#\s-\sIn\sthe\sobject's\sclass\sand\ssuperclasses\s-\sand\stheir\smixins\s-\sin\sclass\n\s\s\s\s#\s\s\straversal\sorder.\n\s\s\s\s#\n\s\s\s\s#\s\s\sClass\straversal\sorder:\sfor\seach\sclass:\n\s\s\s\s#\s\s\s\s\s-\sThe\slist\sof\smixins\sto\sthe\sclass\sis\schecked\sin\snatural\sorder;\seach\n\s\s\s\s#\s\s\s\s\s\s\smixin\s(and\sits\smixins\sand\ssuperclasses)\sis\schecked\sin\sclass\n\s\s\s\s#\s\s\s\s\s\s\straversal\sorder\s(depth-first).\n\s\s\s\s#\s\s\s\s\s-\sThe\sclass\sitself.\n\s\s\s\s#\s\s\s\s\s-\sThe\slist\sof\ssuperclasses\sto\sthe\sclass\sis\schecked\sin\snatural\sorder;\n\s\s\s\s#\s\s\s\s\s\s\seach\ssuperclass\s(and\sits\smixins\sand\ssuperclasses)\sis\schecked\sin\s\n\s\s\s\s#\s\s\s\s\s\s\sclass\straversal\sorder\s(depth-first).\n\s\s\s\s#\sEach\sclass/object\sis\splaces\sas\slate\sin\sthe\sresulting\slist\sas\spossible.\n---\n\n
J foundin current:\s8.6.0
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter twylite
J subsystem 35.\sTclOO\sPackage
J title Method\schain\sorder\snot\scorrectly\sdocumented
J type Bug
K 3606943fffffffffffffffffffffffffffffffff
U twylite
Z 5c96edc862da7e00b945978f7a77ce5f