.
D 2015-04-18T02:57:58.251
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Hi,\r\nwhen\sobjects\sare\screated\sinside\sa\sprocedure\susing\sTclOO\sthey\sare\sglobal\sto\sall\sthe\scurrent\snamespace.\sThey\sare\snot\sdeleted\swhen\sthe\sfunction\sreturns.\r\n\r\nThe\sproblem\sis\sthat\sthese\sobjects\sare\scommands.\sAnd\sall\scommands,\sincluding\sthe\sones\sthat\sare\screated\sinside\sanother\sprocedures,\sare\sglobal\sto\sall\sthe\scurrent\snamespace.\sThe\ssituation\sis\stotally\sdifferent\swith\svariables.\sWhen\sa\svariable\sis\sdefined\sinside\sa\sfunction,\sthis\svariable\sis\slocal\sto\sthis\sfunction.\sWhen\sthe\sfunction\sreturns,\sthis\svariable\sdoes\snot\sexists.\sBut\sinside\sa\sprocedure,\sthis\svariable\scan\sbe\sglobal\sto\sall\sthe\snamespace\susing\sthe\sglobal\scommand.\r\n\r\nI\sthink\sthat\sthis\sbehaviour\sshould\sbe\sequal\swith\sprocs.\sAll\sthe\sprocs\sdefined\sinside\sanother\sproc\sshould\sbe\slocal,\sunless\sthey\sare\sindicated\sas\sglobals\swith\sthe\sglobal\scommand.\sOtherwise\seach\stime\sa\suser\sdefine\sobjects\susing\sTclOO\sinside\sa\sfunction\sthey\swill\snot\sbe\sdeleted\sautomatically\swhen\sthe\sfunction\sreturns.\s\r\n\r\nAnother\spossible\sapproach\sis\sto\screate\sall\sthe\sobjects\sinside\sa\sspecific\snamespace,\sand\sdelete\sthis\snamespace\sbefore\sthe\sfunction\sreturns.\r\n\r\nBut\sthe\sautomatic\sdeletion\sof\slocal\sprocedures\sdefined\sinside\sanother\sprocedure,\sI\sthink\sthat\sit's\sa\sbetter\ssolution\sbecause\sthe\suser\sdoesn't\sneed\sto\sworry\sabout\sto\screate\sa\sspecial\snamespace\sand\sdelete\sthis\snamespace\sbefore\sthe\sfunctions\sreturns.\r\n\r\nAnother\schoice\sis\sto\shave\sa\scontrol\sof\sall\sthe\screated\sobjects\susing\sa\sstatic\svariable\sin\sthe\sclass.\sAnd\sbefore\sthe\sfunction\sreturns\scall\sa\sspecific\sstatic\smethod\sof\sthe\sclass\sto\sremove\sall\sthe\screated\sobjects.\sAgain,\sthe\sdrawback\swith\sthis\sapproach\sis\sthat\sthe\suser\sneeds\sto\sworry\sabout\sto\smake\sa\sclean-up\sbefore\sthe\sfunction\sreturns\scalling\sthis\smethod.
J foundin 8.6
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact 1c4b6cdb98c9dfc4d1e74018f3f4efa00ad217e2
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 07.\sVariables
J title There\sis\sno\snotion\sof\slocal\sprocedure\sinside\sa\sprocedure
J type Bug
K 9ca25bce1341913e910f612f13a64ac9cfea2598
U anonymous
Z 7af7aa3eac6620635f682cc1c0906ce9