Tcl has several "simple" rules about how things are quoted, be it by
[...], {...} or "...".
However, these interact in interesting ways that trip people up. See
http://wiki.tcl.tk/462
for lots of examples. So, my first inclination on finding code executed
outside of a proc
when I wrote it inside, is to hammer the % key a lot. But because
braces can be picked
up by Tcl in comments and in quoted strings, which vim ignores, this
doesn't actually work.
The thing that caught me today was a typo of the form "$names($i}". I
had to use a facility
in TclX to find that particular piece of ghastly horridness:
<code>
package require Tclx
# For the trace commands we need TclX
if { [ catch {package require Tclx } err ] != 0 } {
tk_messageBox -type ok -message "Unable to find package Tclx ...
adjust your auto_path!\n $err";
exit
}
# Stdio dosn't do much with Tk, so we need a log anyway...
set logger [open "thingumibob.log" "w"]
cmdtrace on notruncate procs $logger
cmdtrace on notruncate $logger
</code>
which expands the quotes as Tcl sees them, so you can see why it's doing
what it does.
I've had a look at
http://wiki.tcl.tk/4049
which seems to have not bee updated for vim7.2 but there doesn't seem to
be a solution there.
I'm not really expecting a solution to this, but I'm posting in the hope
that someone might see it, when searching on this issue and find those
links useful, and the far more distant hope that this post will nudge
someone to suddenly invent a solution whilst relaxing in the bath! Of
course, if there is a solution already, I'd be interested in hearing
about it. Meanwhile, I have also found this:
http://nagelfar.berlios.de/
a sort of lint for Tcl, which I will have to explore.
Thank you,
Hugh
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---