From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Nov 26 2008 - 11:13:49 CST

Hi,
  I tried this in tclsh and it behaves the same way for me there
as it does in VMD. This isn't specific to VMD, it's how the
Tcl interpreter works as far as I can tell.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Nov 26, 2008 at 01:26:30PM +0100, Michael Kreim wrote:
> Hi,
>
> I stumbled over some strange behaviour of vmd.
> When I execute the following code vmd hangs up:
> $ cat comment-bug.vmd
> set arr {1 2 3 4 5 6 7 8 9 0}
>
> foreach x $arr {
> puts "${x}"
> # {
> }
>
> exit
>
> $ vmd -dispdev text -e comment-bug.vmd
> Info) VMD for LINUXAMD64, version 1.8.6 (April 6, 2007)
> Info) http://www.ks.uiuc.edu/Research/vmd/
> Info) Email questions and bug reports to vmd_at_ks.uiuc.edu
> Info) Please include this reference in published work using VMD:
> Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
> Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
> Info) -------------------------------------------------------------
> Info) Multithreading available, 4 CPUs detected.
> Info) Free system memory: 1603MB (41%)
> 1 2 3 4 5 6 7 8 9 0
> vmd >
>
> If I delete the line containing the comment everything works as expected.
>
> I looked up the comment part of the TCL8.4 manual and it says:
> > [9] Comments.
> > If a hash character (``#'') appears at a point where Tcl is expecting
> > the first character of the first word of a command, then the hash
> > character and the characters that follow it, up through the next
> > newline, are treated as a comment and ignored. The comment character
> > only has significance when it appears at the beginning of a command.
> From: http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M28
>
> So I think this behaviour is a bug in the vmd TCL interpreter. In my
> understanding of the manual the "{" in "# {" should be ignored.
>
> I found no informations about this bug on the VMD web pages, so maybe
> this one is new to you.
>
> I would be interested if you can reproduce this behaviour and if you
> have any ideas how to change or work around this (beside the obvious not
> to use { in comments).
>
> Thanks a lot and best regards,
>
> Michael Kreim
>
>
> --
> Dipl.-Biol. Michael Kreim <mkreim_at_keychem.de>
> Technische Universität Darmstadt,
> Institut für Botanik, Schnittspahnstr.3, D-64287 Darmstadt
> Eduard-Zintl-Institut für Anorganische und Physikalische Chemie,
> Petersenstraße 20, D-64287 Darmstadt

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078