Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature - How to?

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature - How to?

Post by arijit7 » Wed, 09 May 2007 16:14:02


Hi,

TCL has a command execution syntax like this:

[<tcl cmd>]

Anything inside the 3rd bracket will be executed as a Tcl command by
the Tcl interprater.

Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]?

In other words, my Tcl interprator should print

"[32]"

for tcl command

puts "[32]"

It should not try to treat [] as a special character.

Is this any way possible while extending Tcl in C with tcl.h?

Thank you,
Arijit
 
 
 

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature - How to?

Post by Ralf Fasse » Wed, 09 May 2007 18:06:41

* XXXX@XXXXX.COM
| puts "[32]"
|
| It should not try to treat [] as a special character.

Check out the TCL quoting rules.

http://www.yqcomputer.com/
http://www.yqcomputer.com/ #M10
http://www.yqcomputer.com/ #M15

Any of
puts {[32]}
puts "\[32\]"
will do the trick.

R'

 
 
 

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature - How to?

Post by Larry W. V » Wed, 09 May 2007 20:56:23


By doing this, you would disable the primary functionality of Tcl.

I'm certain you could go into the tcl source and stop it - but why not
talk about what you are really trying to do. Perhaps someone can give
you a better way of doing what you are wanting to do.