.
D 2000-10-26T01:04:00
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1704\sRFE\nVersion:\s8.1b2\nSubmitDate:\s'1999-04-05'\nLastModified:\s'1999-07-02'\nSeverity:\sCRIT\nStatus:\sReleased\nSubmitter:\spat\nChangedBy:\sstanton\nOS:\sOther\nOSVersion:\sall\sversions\sof\sUNIX\nMachine:\sNA\nFixedDate:\s'1999-07-02'\nFixedInVersion:\s8.2\nClosedDate:\s'2000-10-25'\n\n\nName:\nDon\sLibes\n\nExtensions:\nExpect\n\nComments:\nThese\sare\snecessary\sin\sorder\sto\sget\sExpect\sto\scompile\swith\sTcl\s8.1.\n\nDesiredBehavior:\n1)\sI'm\sreading\sRegExp.3.\s\sIt\stalks\sabout\sTcl_RegExpCompile.\s\sHowever\sin\n\s\s\s\sthe\scode\sfor\sthat,\sit\ssays:\n\s\s\s\s\n\s\s\s\s\s\sThis\sprocedure\sis\sDEPRECATED\sin\sfavor\sof\sthe\sobject\sversion\sof\sthe\n\s\s\s\s\s\scommand.\n\s\s\s\s\n\s\s\s\sI\slooked\sfurther\sand\sfound\sTclRegCompObj\swhich\sI\sassume\sis\swhat\sis\n\s\s\s\smeant\sas\sthe\sobject\sversion.\s\sHowever,\sit\sappears\sto\sbe\sfor\sinternal\n\s\s\s\suse\sonly.\s\sPlease\sfix\sor\sexplain.\n\s\s\s\s\n\s\s\s\s2)\sThe\sman\spage\sfor\sTcl_RegExpCompile\ssays:\n\s\s\s\s\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\scompiles\s\sa\s\sregular\s\sexpression\n\s\s\s\s\s\s\s\s\sstring\s\sinto\s\sthe\s\sinternal\s\sform\sused\sfor\sefficient\spattern\n\s\s\s\s\s\s\s\s\smatching.\s\sThe\sreturn\svalue\sis\sa\s\stoken\s\sfor\s\sthis\s\scompiled\n\s\s\s\s\s\s\s\s\sform,\s\s\swhich\s\s\scan\s\s\sbe\s\s\sused\s\s\sin\s\s\ssubsequent\s\scalls\s\sto\n\s\s\s\s\s\s\s\s\sTcl_RegExpExec\sor\sTcl_RegExpRange.\n\s\s\s\s\n\s\s\s\sThe\sregexp\sman\spage\sgoes\son\sto\ssay:\n\s\s\s\s\n\s\s\s\s\s\s\s\s\sNote:\s\sthe\sreturn\svalue\sfrom\sTcl_RegExpCompile\sis\sonly\svalid\n\s\s\s\s\s\s\s\s\sup\sto\sthe\snext\scall\sto\sTcl_RegExpCompile;\s\sit\sis\snot\ssafe\sto\n\s\s\s\s\s\s\s\s\sretain\sthese\svalues\sfor\slong\speriods\sof\stime.\n\s\s\s\s\n\s\s\s\sWe\scannot\ssave\scompiled\sregexps?\s\sThis\sis\svery\sbad\sfor\sthings\slike\n\s\s\s\sExpect\swhich\ssit\sin\sa\sloop\sdoing\srepeated\sregexec's\swith\sa\spotential\n\s\s\s\slarge\snumber\sof\sregexps.\s\sPlease\slet\sme\scall\sCompileRegexp\sdirectly.\n\s\s\s\s\n\s\s\s\s2.5)\sI\salso\swant\sto\sbe\sable\sto\scall\sHenry's\sregexp\sfunctions\sdirectly\n\s\s\s\s(just\sthe\sway\sTcl\sdoes).\s\sI've\sgot\scode\sthat\sknows\snothing\sabout\sTcl\n\s\s\s\sbut\sthat\suses\sregexps\sand\sI\sneed\sto\suse\sHenry's\scode.\s\sI\scan't\schange\n\s\s\s\sthis\scode\sto\sgo\sthrough\sTcl\sso\sthe\sway\sit\sis\snow,\sI\swould\sneed\sto\n\s\s\s\sdownload\s(or\sship)\smy\sown\scopy\sof\sHenry's\scode\sand\s.h\sfiles.\s\sPlease\n\s\s\s\sjust\smake\ssure\sthat\sthe\sHenry's\spublic\sinterfaces\sremain\spublic.\s\sI'm\n\s\s\s\snot\sasking\sto\sexpose\sHenry's\sprivate\sinterfaces.\s\sI\sjust\swant\saccess\n\s\s\s\sto\sthe\spublic\sones.\s\sI\sthink\syou\scan\saccomodate\sthis\smerely\sby\n\s\s\s\sinstalling\sthe\sappropriate\s.h\sfiles\sfrom\shis\slibrary.\s\sIt\sdoes\snot\n\s\s\s\sappear\sthat\syou\sdo\sthis\snow.\n\s\s\s\s\n\s\s\s\s3)\sI\ssee\sthat\sTclRegCompObj\sdoesn't\scache\sregexps\sand\sallows\sthe\suser\n\s\s\s\sto\sexplicitly\skeep\sthe\sregexp.\s\sIt\sappears\sthat\sthe\sTcl\score\suses\n\s\s\s\sTclRegCompObj\sdespite\sthe\slack\sof\scaching.\s\sThis\scan't\sbe\sright,\sright?\n\s\s\s\s\n\s\s\s\sOne\sway\sto\sunify\sthings\sis\sto\sadd\san\s"enableCache"\sflag\s(to\sboth\n\s\s\s\sTcl_RegExpCompile\sand\sTclRegCompObj).\s\sIf\senableCache\s==\s0,\sthen\sthe\n\s\s\s\scache\sis\sneither\schecked\snor\supdated.\s\sThis\sis\sa\sreasonably\ssimple\sfix\n\s\s\s\sas\sit\swon't\saffect\sany\sexisting\sbehavior\sand\sonly\srequires\schanges\sto\n\s\s\s\sthe\sfew\splaces\swhere\sTcl\sinternally\scurrently\scompiles\sregexps.\n\s\s\s\s\n\s\s\s\sThis\sis\snot\sonly\suseful\sto\sextensions\sbut\sit's\suseful\sto\sthe\sTcl\score\n\s\s\s\sas\sthere\sare\splaces\sin\sthe\score\swhere\scaching\sis\sappropriate\sand\swhere\n\s\s\s\sit's\suseless.\n\s\s\s\s\n\s\s\s\s4)\sThe\sstatement\s"it\sis\snot\ssafe\sto\sretain\sthese\svalues\sfor\slong\n\s\s\s\speriods\sof\stime"\sis\srather\ssilly.\s\sNo\sone\scan\spossibly\sunderstand\sit\n\s\s\s\swithout\slooking\sat\sthe\ssource.\s\sAnd\swhen\syou\sdo\sunderstand\sit,\sit\n\s\s\s\scontradicts\sthe\sprevious\sstatement.\s\sPlease\srewrite\sboth\sstatements\sto\n\s\s\s\sbe\sexplicit\sabout\swhat's\sreally\sgoing\son.\n\s\s\s\s\n\s\s\s\s5)\s5\sis\sa\sreally\ssmall\scache.\s\sAny\spossibility\sof\sraising\sthis\sor\n\s\s\s\sputting\sit\sunder\suser\scontrol?\n\s\s\s\s\n\s\s\s\s6)\sThe\sdocumentation\sfor\sTcl_RegExpExec\ssays:\n\s\s\s\s\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sreturns\s1\sif\sstring\scontains\sa\srange\sof\scharac-\n\s\s\s\s\s\s\s\s\sters\sthat\smatch\sregexp,\s0\sif\sno\smatch\sis\sfound,\sand\s-1\sif\san\n\s\s\s\s\s\s\s\s\serror\s\soccurs.\n\s\s\s\s\n\s\s\s\sI\ssee\sno\sway\sfor\sTcl_RegExpExec\sto\sindicate\s"could\smatch"\smeaning\n\s\s\s\s"could\smatch\sif\smore\scharacters\sarrive\sthat\swere\ssuitable\sfor\sa\n\s\s\s\smatch".\s\sThis\sis\srequired\sfor\sa\sclass\sof\sapplications\sinvolving\n\s\s\s\smatching\son\sa\sstream\srequired\sby\sExpect's\sinteract\scommand.\s\sHenry\n\s\s\s\sassured\sme\sthat\sthis\sfacility\swould\sbe\sin\sthe\sengine\s(I'm\snot\sthe\sonly\n\s\s\s\sone\sthat\sneeds\sit).\s\sNote\sthat\sit\sis\snot\ssufficient\sto\sadd\sone\smore\n\s\s\s\sreturn\svalue\sto\sTcl_RegExpExec\s(i.e.,\s2)\sbecause\sone\sneeds\sto\sknow\n\s\s\s\sboth\sif\ssomething\smatches\snow\sand\scan\smatch\slater.\s\sI\srecommend\n\s\s\s\sanother\sargument\s(canMatch\s*int)\sbe\sadded\sto\sTcl_RegExpExec.\n\s\s\s\s\n\s\s\s\s7)\sThe\sregexp\sman\spage\ssays:\n\s\s\s\s\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sIf\san\serror\soccurs\swhile\n\s\s\s\s\s\s\s\s\scompiling\s\sthe\s\sregular\s\sexpression\s\sthen\s\sTcl_RegExpCompile\n\s\s\s\s\s\s\s\s\sreturns\sNULL\sand\sleaves\san\serror\smessage\sin\s\sinterp->result.\n\s\s\s\s\n\s\s\s\sI\ssuggest\syou\sreplace\s"interp->result"\swith\smore\ssuitable\swords.\n\s\s\s\s\n\s\s\s\sHmm,\sI\ssee\sthat\sTcl_SetObjResult.3\ssays\sinterp->result\sis\s"strongly\n\s\s\s\sdeprecated".\s\sYet,\sinterp->result\sappears\s591\stimes\sin\sthe\sman\spages\n\s\s\s\sincluding\sTcl_Interp.3\swhich\sdefines\sinterp->result\swith\sno\smention\sof\n\s\s\s\san\salternative.\s\s(In\scase\syou're\swondering\swhy\smy\scode\sis\sstill\n\s\s\s\slittered\swith\sinterp->result,\shopefully\sthis\sexplains\sit.)\n\n\n\n05/12/1999\s18:41\s-\sstanton\s-\sTcl_GetRegExpFromObj\sis\snow\spublic.\n\n07/02/1999\s10:48\s-\sstanton\s-\sall\sof\sthe\sregexp\sissues\srelated\sto\sexpect\shave\sbeen\sresolved.\n\n
J foundin obsolete:\s8.1b2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 43.\sRegexp
J title regexp\sdeficiencies
J type Bug
K 218674ffffffffffffffffffffffffffffffffff
U nobody
Z 78e4eb82fbd038bf0a365ab793c92803