toCodeBlock :: T.TclObj -> TclM CodeBlock
toCodeBlock o = do
   (e_cmds,st) <- R.asParsed o >>= liftIO . compile
   carr <- makeCmdArray st >>= return . CmdCache
   registerWatcher (invalidateCache carr)
   case e_cmds of
     Left e -> tclErr e
     Right cmds -> return (CodeBlock carr cmds)
toCodeBlock :: T.TclObj -> TclM CodeBlock
toCodeBlock o = do
   (e_cmds,st) <- R.asParsed o >>= liftIO . compile
   carr <- makeCmdArray st >>= return . CmdCache
   registerWatcher (invalidateCache carr)
   case e_cmds of
     Left e -> tclErr e
     Right cmds -> return (CodeBlock carr cmds)
toCodeBlock o = do
   (e_cmds,st) <- R.asParsed o >>= liftIO . compile
   carr <- makeCmdArray st >>= return . CmdCache
   registerWatcher (invalidateCache carr)
   case e_cmds of
     Left e -> tclErr e
     Right cmds -> return (CodeBlock carr cmds)