Tcl/Tk: Handling String Expressions | Linux Today

Tcl/Tk: Handling String Expressions

Written By
Web Webster
Web Webster
Mar 9, 2011

[ Thanks to Naheed
for this link. ]

“Tcl (Tool Command Language) is a scripting language
originally designed for embedded system platforms. Since its
creation, Tcl has grown far beyond its original design with
numerous expansions and additions (such as the graphical Took Kit
or Tk) to become a full-featured scripted programming language
capable of creating elegant, cross-platform solutions.

“Introduction

“When I first started using Tcl, everything I read or researched
stressed the mantra “Everything is a string”. Coming from a
hard-typed coding environment, I was used to declaring variable
types and in Tcl this was not needed. A set command could—and
still does—create the variable and assigns the type on the
fly. For example, set variable “7” and set variable 7 will both
create a variable containing 7. However, with Tcl, you can still
print the variable containing a numeric 7 and add 1 to the variable
containing a string representation of 7.

“It still holds true today that everything in Tcl is a string.
When we explore the TK Toolkit and widget creation, you will
rapidly see that widgets themselves have a set of string values
that determine their appearance and/or behavior.”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.