.
D 2008-07-18T12:28:33
J assignee nijtmans
J cmimetype text/plain
J comment Currently,\sthere\sis\sinconsistance\shere:\n>tclsh8.4\n%\sproc\sfoo\s{a\sb\sc\sargs}\ssomething\n%\sfoo\sx\nwrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\sargs"\n>tclsh8.5\n%\sproc\sfoo\s{a\sb\sc\sargs}\ssomething\n%\sfoo\sx\nwrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s..."\n%\sinterp\salias\nwrong\s#\sargs:\sshould\sbe\s"interp\salias\sslavePath\sslaveCmd\s?masterPath\nmasterCmd?\s?args\s..?"\n%\sdict\nwrong\s#\sargs:\sshould\sbe\s"dict\ssubcommand\s?argument\s...?"\n%\n\nBefore\sstarting\seffort\sto\sstreamline\sthis,\swhat\sis\sthe\sprefered\sversion?\sPlease\nvote\sfor\sone\sof\sthe\sfollowing:\n\nA:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\sargs"\s(8.4\sproc\svariant)\nB:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s..."\s(8.5\sproc\svariant)\nC:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?args\s...?"\s(interp\salias\svariant)\nD:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?argument\s...?"\s(dict\svariant)\nE:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?\s...?"\s(just\sfor\scompleteness)\n\nThere\sare\ssome\scorner\scases,\slike:\n%\sdict\screate\sx\nwrong\s#\sargs:\sshould\sbe\s"dict\screate\s?key\svalue\s...?"\n\nAt\sfirst\ssight,\smy\spreference\swould\sbe\sB,\sbut\slooking\sat\sthe\s"dict\screate"\nexample,\sthen\sC\smight\sbe\smore\slogical:\sThe\squestion\smark\sdenotes\sthat\nthe\sremaining\sarguments\sare\soptional,\sbetween\sit\sis\ssome\shint\nwhat\sis\sexpected\s('args'\salready\shas\sa\sspecial\smeaning\sin\sTcl),\sand\sthe\ndots\ssignify\sthat\sthe\sarguments\sbefore\sit\scan\sbe\srepeated\sat\swill.\n\nAny\sother\sideas?\n\nRegards,\n\s\s\s\s\s\s\s\s\sJan\sNijtmans\n\n================================================\nThis\sall\sIMHO...\n\n\nOn\sThu,\s10\sJul\s2008,\sJan\sNijtmans\swrote:\n\n\s\s\s\sBefore\sstarting\seffort\sto\sstreamline\sthis,\swhat\sis\sthe\sprefered\sversion?\sPlease\n\s\s\s\svote\sfor\sone\sof\sthe\sfollowing:\n\n\s\s\s\sA:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\sargs"\s(8.4\sproc\svariant)\n\n\nThis\scould\simply\sto\ssomeone\snot\sfamiliar\swith\s'args',\sor\snot\sknowing\sit's\sa\sproc\sand\snot\sa\scommand,\sthat\sa\sfourth\sargument\sis\srequired.\s\sWithout\sthe\selipsis\syou\sdon't\sknow\s(unless\syou\sknow\sit's\sa\sproc)\sthat\sfoo\scan\stake\smore\sthan\s4\sarguments,\sthough\sit's\ssafe\sguess.\n\n\n\s\s\s\sB:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s..."\s(8.5\sproc\svariant)\n\n\nThis\sto\sme\simplies\s"one\sor\smore\sc's",\swhich\sisn't\sgenerally\scorrect\sbecause\s'args'\sdoesn't\simply\sit's\slimited\sto\sc's.\n\n\n\s\s\s\sC:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?args\s...?"\s(interp\salias\svariant)\n\n\nThis\sto\sme\simplies\s"zero\sor\smore\slists\sof\sarg",\swhich\sisn't\scorrect\sbecause\sall\sthe\soptional\sarguments\sare\sin\sa\ssingle\slist.\n\n\n\s\s\s\sD:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?argument\s...?"\s(dict\svariant)\n\n\nThis\sto\sme\simplies\s"zero\sor\smore\sadditional\sarguments",\swhich\sis\sthe\smost\scorrect,\sbut\sI'd\sgo\swith\s'arg'\sinstead\sas\sthe\ssingular\sform\sof\s'arg'.\n\n\n\s\s\s\sE:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?\s...?"\s(just\sfor\scompleteness)\n\n\nThis\sto\sme\simplies\s"zero\sor\smore\ssomethings",\swhich\sis\sokay\ssince\s'args'\sis\samibguous\sas\sto\swhat's\sexpected\s(just\szero\sor\smore\ssomethings),\sbut\s'?arg\s...?'\spoints\sto\sthe\sfact\sthat\sits\sa\sproc\swith\san\s'args'\svariable.\n\n[nitpicky:\sspace\son\sboth\ssides\sor\sneither,\snot\sone\sside.]\n\n\n\s\s\s\sThere\sare\ssome\scorner\scases,\slike:\n\s\s\s\s%\sdict\screate\sx\n\s\s\s\swrong\s#\sargs:\sshould\sbe\s"dict\screate\s?key\svalue\s...?"\n\n\nThis\sform\sis\sappropriate\swhen\sthere\sare\smore\sspecific\srequirements\sfor\sthe\soptional\sarguments\sthat\scan\sbe\sreflected\sin\sthe\susage.\s\sIn\sthis\scase,\sit\ssays\syou\scan\sspecify\sadditional\sarguments,\sbut\sthere\smust\sbe\sa\smultiple\sof\stwo\sand\seach\spair\sis\sa\skey\sand\sa\svalue.\n\nIt's\snot\sreally\sa\scorner\scase\sso\smuch\sas\sa\smore\sspecific\scase.\s\sConsider\sa\ssomething\sslightly\sdifferent\sfrom\sB:\n\nwrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\s?c\s...?"\n\nIn\scontrast\swith\sB,\sthis\ssays\sit\smust\sbe\szero\sor\smore\sc's\s(but\sonly\sc's\scan\sfollow\sat\sthe\send).\s\sThat\swould\sbe\smore\sspecific\sthan\s"foo\sa\sb\s?arg\s...?"\sbecause\s"arg"\sis\snon-specific,\sbut\syou\scan't\sget\sthat\s"?c\s...?"\sform\sautomatically\swith\sa\sproc.\n\nSo,\sIMHO,\sthis\swould\sbe\smost\scorrect\sand\sspecific\sfor\sprocs:\n\n\n%\sproc\sfoo\s{a\sb\sc\sargs}\ssomething\n%\sfoo\sx\nwrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?arg\s...?"\n\nFor\scommands,\sit\sdepends\sentirely\son\swhat\sforms\sthe\soptional\sarguments\scan\stake\sand\sin\swhat\sorder.\n\n--\nMichael\sKirkham\nPresident\s&\sCEO\nMuonics,\sInc.\nhttp://www.muonics.com/\n\n=====================================================\nJan\sNijtmans\swrote:\n\n\s\s\s\sBefore\sstarting\seffort\sto\sstreamline\sthis,\swhat\sis\sthe\sprefered\sversion?\sPlease\n\s\s\s\svote\sfor\sone\sof\sthe\sfollowing:\n\n\s\s\s\sA:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\sargs"\s(8.4\sproc\svariant)\n\s\s\s\sB:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s..."\s(8.5\sproc\svariant)\n\s\s\s\sC:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?args\s...?"\s(interp\salias\svariant)\n\s\s\s\sD:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?argument\s...?"\s(dict\svariant)\n\s\s\s\sE:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?\s...?"\s(just\sfor\scompleteness)\n\n\nI'd\sagree\swith\swhat\sMichael\sKirkham\swrote:\sD,\sbut\swith\sarg.\n\n\s\s\s\sAny\sother\sideas?\n\n\nWhatever\sis\schosen,\sthe\schoice\sshould\sbe\sdocumented\s--\sif\snot\sin\sa\smanpage,\sthen\son\sthe\swiki\sor\sin\sa\sTIP\s--\ssince\sscript\swriters\salso\sneed\sto\sknow\sthe\srecommended\sstyle\sfor\sthis\soccationally\s(e.g.\swhen\scoding\sprocs\sthat\sdo\sfurther\ssyntax\schecks\son\san\sargs\sargument\sand\swant\sto\sthrow\snice-looking\serror\smessages).\n\nA\srelated\smatter\sis\sthat\sof\sdistinguishing\sbetween\sformal\sand\sactual\sarguments,\si.e.,\sbetween\snames\sof\sarguments\s(a\sb\sc\sargs\sabove)\sand\svalues\sactually\ssupplied\sby\sthe\suser.\sIn\sA-E\sabove\sonly\sthe\sfoo\sfalls\sin\sthis\scategory,\sbut\sit\scan\sbe\smuch\smore:\n\n%\snamespace\sensemble\sconfigure\nwrong\s#\sargs:\sshould\sbe\s"namespace\sensemble\sconfigure\scmdname\s?opt?\s?value?\s..."\n\nHere\snamespace,\sensemble,\sand\sconfigure\sare\sactual\sarguments,\swhereas\scmdname,\sopt,\sand\svalue\sare\sformal\sarguments.\sThis\sdistinction\scould\sperhaps\sbe\sshown\ssomehow.\n\nAlso,\sat\sthe\srisk\sof\sdrawing\snegative\sattention:\sI\sencountered\sthis\sproblem\swhen\swriting\sthe\sreference\simplementation\sof\sTIP#314\s--\ssee\sthe\slast\sbut\sone\ssection\s"Notes"\sin\sthat\sTIP.\sEnsembles\splay\ssome\stricks\sto\spreserve\sactual\sarguments,\sand\sI\stried\sto\sfollow\sthe\spattern\salready\sestablished.\n\nLars\sHellström\n==================================================\nJan\sNijtmans\swrote:\n\n\s\s\s\sCurrently,\sthere\sis\sinconsistance\shere:\n\n\nThat\swas\san\sexplicit\schange,\sand\sbrought\sthe\s"wrong\s#\sargs"\sgeneration\sof\sprocedures\sinto\sthe\ssame\sframework\sas\sthe\srest\sof\sTcl.\sIn\sturn,\sthat\smakes\sensemblified\scommands\sproduce\smore\suseful\serror\smessages.\sAs\spart\sof\sthe\sprocess\sI\saltered\sthe\srendering\sof\serror\smessages\sproduced\sby\sprocedures\sso\sthat\sthey\sappear\smore\suseful\sfor\snormal\susers,\sso\soptional\sarguments\sare\ssurrounded\sby\s?'s\sand\sargs\swas\sreplaced\sby\san\sellipsis,\swhich\sgives\sa\sreasonably\snice\svisual\seffect.\n\nI\sdidn't\sgo\sthrough\sand\saudit\severything\sfor\sperfect\sconsistency.\sNo\stime.\sSo\sthere.\s:-)\n\n\n\s\s\s\sBefore\sstarting\seffort\sto\sstreamline\sthis,\swhat\sis\sthe\sprefered\sversion?\sPlease\n\s\s\s\svote\sfor\sone\sof\sthe\sfollowing:\n\n\s\s\s\sA:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\sargs"\s(8.4\sproc\svariant)\n\s\s\s\sB:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s..."\s(8.5\sproc\svariant)\n\s\s\s\sC:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?args\s...?"\s(interp\salias\svariant)\n\s\s\s\sD:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?argument\s...?"\s(dict\svariant)\n\s\s\s\sE:\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?\s...?"\s(just\sfor\scompleteness)\n\n\nMy\spreference\sis\s"not\sA",\sand\sfix\sthe\s[dict]\sinconsistency\s(so\s"not\sD"\stoo).\sApart\sfrom\sthat,\sI'm\shappy\sto\sjust\swatch\swhat\sothers\sprefer.\n\nDonal.\n=================================================\nLars\sHellström\swrote:\n\n\s\s\s\sWhatever\sis\schosen,\sthe\schoice\sshould\sbe\sdocumented\s--\sif\snot\sin\sa\smanpage,\sthen\son\sthe\swiki\sor\sin\sa\sTIP\s--\ssince\sscript\swriters\salso\sneed\sto\sknow\sthe\srecommended\sstyle\sfor\sthis\soccationally\s(e.g.\swhen\scoding\sprocs\sthat\sdo\sfurther\ssyntax\schecks\son\san\sargs\sargument\sand\swant\sto\sthrow\snice-looking\serror\smessages).\n\n\nI\sdisagree.\sWe've\snever\sever\sdocumented\sthe\sformat\sof\ssyntax\serrors.\n\n\n\s\s\s\sHere\snamespace,\sensemble,\sand\sconfigure\sare\sactual\sarguments,\swhereas\scmdname,\sopt,\sand\svalue\sare\sformal\sarguments.\sThis\sdistinction\scould\sperhaps\sbe\sshown\ssomehow.\n\n\nI\sdisagree\sagain.\sMostly\sbecause\sit's\sawkward\sto\srender\sthings\sin\sbold\sand\sitalics\swithout\sgetting\sinto\sother\sproblems.\s"Check\sthe\smanual\spage\sif\syou're\sconfused,\sguys!"\s:-)\sI\ssuppose\swe\scould\sdo\stricks\slike\sb^Hbo^Hol^Hld^HD\sor\si^H_t^H_a^H_l^H_i^H_c^H_s^H_\sbut\sthat's\s*really*\sugly\swhen\sit\sgoes\swrong\sor\sif\syou're\strying\sto\shandle\sit\swith\sscripts.\n\nDonal.\n==================================================\n8\sdays\sago,\sI\sstarted\sthis\sthread\sand\s3\speople\sreacted.\sFirst\sof\sall,\na\sbig\sthanks!\sIt\sclearified\sa\slot\sto\sme.\n\nThen\sthe\sresult.\sMichael\sKirkham\scame\sto\sthe\sfollowing\sconclusion:\n\s\s\s\s>\sSo,\sIMHO,\sthis\swould\sbe\smost\scorrect\sand\sspecific\sfor\sprocs:\n\s\s\s\s>\n\s\s\s\s>\s%\sproc\sfoo\s{a\sb\sc\sargs}\ssomething\n\s\s\s\s>\s%\sfoo\sx\n\s\s\s\s>\swrong\s#\sargs:\sshould\sbe\s"foo\sa\sb\sc\s?arg\s...?"\nand\she\sgave\sa\slot\sof\spro's\sand\scontra's\sfor\seach\sof\sthe\svariations.\nThis\svariant\swas\snot\sin\smy\slist,\sbut\sit\sactually\sis\sused\sin\na\slot\sof\splaces\sin\sTcl,\se.g.:\n%\sencoding\nwrong\s#\sargs:\sshould\sbe\s"encoding\soption\s?arg\s...?"\n%\sinterp\nwrong\s#\sargs:\sshould\sbe\s"interp\scmd\s?arg\s...?"\n%\snamespace\nwrong\s#\sargs:\sshould\sbe\s"namespace\ssubcommand\s?arg\s...?"\n\nI\shave\sto\sagree\swith\shim,\sand\swith\sthe\sother\sarguments\sgiven.\nSo,\stherefore\sI\swould\slike\sto\sdeclare\sthis\sas\sthe\swinner!!!!\n\n2008/7/10\sDonal\sK.\sFellows\s<[email protected]>:\n>\sLars\sHellström\swrote:\n>>\sWhatever\sis\schosen,\sthe\schoice\sshould\sbe\sdocumented\s--\sif\snot\sin\sa\n>\sI\sdisagree.\sWe've\snever\sever\sdocumented\sthe\sformat\sof\ssyntax\serrors.\n\nDocumenting\sthis\shas\sthe\sdisadvantage\sthat\swe\shave\sto\sstick\swith\nit\sand\sthat\swe\sshould\stake\scare\sthat\sthe\sTcl\score\sfollows\sthe\ndocumentation.\n\n2008/7/10\sDonal\sK.\sFellows\s<[email protected]>:\n>\sLars\sHellström\swrote:\n>>\sHere\snamespace,\sensemble,\sand\sconfigure\sare\sactual\sarguments,\swhereas\n>>\scmdname,\sopt,\sand\svalue\sare\sformal\sarguments.\sThis\sdistinction\scould\sperhaps\n>>\sbe\sshown\ssomehow.\n>\n>\sI\sdisagree\sagain.\sMostly\sbecause\sit's\sawkward\sto\srender\sthings\sin\sbold\sand\n>\sitalics\swithout\sgetting\sinto\sother\sproblems.\s"Check\sthe\smanual\spage\sif\n>\syou're\sconfused,\sguys!"\s:-)\sI\ssuppose\swe\scould\sdo\stricks\slike\n>\sb^Hbo^Hol^Hld^HD\sor\si^H_t^H_a^H_l^H_i^H_c^H_s^H_\sbut\sthat's\s*really*\sugly\n>\swhen\sit\sgoes\swrong\sor\sif\syou're\strying\sto\shandle\sit\swith\sscripts.\n\nI\sdon't\swant\sto\sadd\sany\smore\sthan\sconsistancy,\sthat's\salready\swork\senough.\n\nThe\sreason\sI\scame\sup\swith\sthis,\sis\sthat\sI\swrote\sa\ssmall\sproc\sin\swhich\sthe\ssecond\nargument\swas\sa\skind\sof\ssubcommand,\shandled\sby\sa\s"switch".\sLater\sI\srewrote\nit\susing\snamespace\sensemble,\sand\snoticed\sthat\sthe\serror-messages\schanged.\n\nRegards,\n\s\s\s\s\s\s\s\s\s\s\s\sJan\sNijtmans\n
J foundin obsolete:\s8.6a1
J is_private 0
J priority 2
J resolution None
J status Open
J submitter nijtmans
J subsystem 69.\sOther
J title inconsistant\s"wrong\s#\sargs"\smessages
J type Bug
K 2021443fffffffffffffffffffffffffffffffff
U nijtmans
Z cfb69e35248a43cd17a0bd96ed8fe36d