*** Practical_Advice_on_Quotes_and_Braces_in_TCL *** This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Its very hard to reply reasonably without some background of the correspondent on their Wiki bio page. Thanks,[gold] ---- <> ***Title: Practical_Advice_on_Quotes_and_Braces_in_TCL*** ***Preface*** [gold]12Dec2018. Here are some practical rules on curly braces and quotes in TCL. Per question of “ What is the difference between double quotes (" ") and Braces { } ? “ from Kh_Yogananda_Raj_Urs. More complete references etc are listed below. ---- ***Introduction*** ---- Here are some practical rules on curly braces and quotes in TCL. curly braces are essential to speed up math expressions in expr. Quotes are mainly used for exact text strings with some variable substitution. For example, puts " result value is expr { 1+3} " and print out is . If you are using the TCL console or easy eye calculator in the file system, paste in the TCL statement and this should show in big fonts on the console window. From the inside the double quotes the text is output exactly, whereas math expressions and $variables are evaluated inside the quotes. For practical use on the same line of code, quotes in TCL can printout exact text, text titles of variables, evaluated expressions, and $variables stored in programs. ---- Aside from expr, curly braces are used with list command like set lister1 { dog cat lizard } to store separate items in a list. The statement as three text variables stored in a single list. Quotes can act as a basket, mold, or glue to store text phrases inside the interpreter (in list structure). The TCL interpreter will see as two text variables of " dog cat” and “lizard” in a list. The TCL interpreter will see as one text variable in a list. The TCL interpreter will see as one text variable in a single string of text characters. The gist is that quotes and curly braces are used to tell the TCL interpreter how to evaluate the enclosed items either in parts or whole string, and much differently in some usage. Part of the confusion is that can either be treated as either one item, two items, or three items in the interpreter, but the simple print out on the TCL console looks the same regardless. --- The key concept is how the items and information are stored and typed in the TCL interpreter either as a text string or list. The interpreter will usually try to type or tag the loaded data immediately. For an analogy in reading, the human brain loads the items above and tags them with associations, like fur for “dog cat”,scales for “lizard”, and teeth & claws for all. But the treatment of in the mental processes generally depends on the use and association (symbols) for each individual item. --- ***Conclusions*** --- The key concept is how the items and information are stored and typed in the TCL interpreter either as a text string or list. The interpreter will usually try to type or tag the loaded data immediately. For an analogy in reading, the human brain loads the items above and tags them with associations, like fur for “dog cat”,scales for “lizard”, and teeth & claws for all. But the treatment of in the mental processes generally depends on the use and association (symbols) for each individual item. ---- ***References:*** * google < braces brackets quotes TCL WIKI > * Wikipedia search engine < brackets quotes braces TCL > * TCL wiki search engine * TCL wiki search engine * TCL wiki search engine * TCL wiki search engine * Practical Programming in Tcl and Tk * By Brent Welch * Highly recommended, a virtual Bible of TCL. * Used copies and early editions are fairly cheap * and free shipping on Amazon. * [Testing for Balanced Brackets and Braces] * [WJG] (21/12/18) * [Tcl Quoting] * [expr] * [Online books] * [Easy Eye Calculator and eTCL Slot Calculator Demo Example, Numerical Analysis] * [Book Practical Programming in Tcl and Tk, Fourth Edition] * [Quoting Heaven!] * [Tcl Quoting] * [Brace your expr-essions] ---- ---- **Appendix Code** *** Trial Console Program *** ====== # TCL source code follows # ASED autoindent applied # Trial Console Program brackets and quotes. # written on Windows XP on TCL # working under TCL version 8.6 # gold on TCL Club, 12Dec2018 console show puts " result value is [expr { 1+3} ] "; puts [expr { 1+3} ]; set lister1 { dog cat lizard } ; puts $lister1; set lister2 {" dog cat lizard" }; puts $lister2; set lister3 {" dog cat” lizard }; puts $lister3; set lister4 " dog cat lizard" ; $lister4; # note outputs are similar # for $lister1 and $lister4 # gold on TCL Club, 12Dec2018 ====== ---- ---- ---- **Hidden Comments Section** <> Please place any comments here with your wiki MONIKER and date, Thanks[gold]12Dec2018 ---- <> Numerical Analysis | Toys | Calculator | Mathematics| Example| Toys and Games | Games | Application | GUI