Skip to main content



      Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Tcl wrong error marking(Tcl wrong error mark: "Extra characters after close-brace")
icon4.gif  Tcl wrong error marking [message #847927] Tue, 17 April 2012 15:50 Go to next message
Eclipse UserFriend
Hi guys.
Some moths ago I started to use DLTK for my Tcl work projects, and all works fine until i use tcl script evaluation.
When i write a code like this:
grid $variablename {*}$arguments

The $arguments variable gets marked as an sintax error. But it's not such an error int Tcl. It's a part of Tcl specification:

www.tcl.tk/man/tcl8.5/TclCmd/eval.htm
Note that in the most common case (where the script fragment is actually just a list of words forming a command prefix), it is better to use {*}$script when doing this sort of invocation pattern. It is less general than the eval command, and hence easier to make robust in practice. The following procedure acts in a way that is analogous to the lappend command, except it inserts the argument values at the start of the list in the variable:


So, is there a way to add an exception to marking rules? Because it's quite anoying some times having an error you know it isn't.
Hope I explained well my problem.

Ros.

[Updated on: Fri, 20 April 2012 10:30] by Moderator

Re: Wrong error marking [message #847960 is a reply to message #847927] Tue, 17 April 2012 16:40 Go to previous message
Eclipse UserFriend
Hi again.
I realized that this error can be avoided by writing the code otherwise:
set comvar "grid $variablename $arguments"
eval $comvar

This is similar to but not as elegant as:
grid $variablename {*}$arguments
Cool

Ros.
Previous Topic:Noob: run/rspec mismatch?
Next Topic:Migrating from 2.0 to 3.0 or 4.0
Goto Forum:
  


Current Time: Tue Jul 22 22:44:09 EDT 2025

Powered by FUDForum. Page generated in 0.40066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top