‹ BackHN Continuity

Thread

Tcl/Tk 9.1

304 points · 144 comments · dmux

  1. qalmakka · · focus · HN ↗
    Tcl is way too smart of a language for its own good. I love how everything is a string or can be hacked on a string, so you can basically do levels of metaprogramming that reach unheard of levels
    1. srean · · focus · HN ↗
      Not to mention uplevels and upvar.
      1. wduquette · · focus · HN ↗
        All of which I used many years to go to write "Snit", a quite nice object system for coding up Tcl objects and Tk widgets. Snit's a TCL library that takes a nice, easily readable description of your desired object type (the instance variables, the methods, and so forth), translates it immediately into standard TCL, and then evaluates that to define your type. Basically, it's a macro system for defining object types. (I say "object types" rather than "classes" because there is no inheritance.)
        1. srean · · focus · HN ↗
          Would this be the best place to learn about it

          <a href="https:&#x2F;&#x2F;wiki.tcl-lang.org&#x2F;page&#x2F;Snit%27s+Not+Incr+Tcl" rel="nofollow">https:&#x2F;&#x2F;wiki.tcl-lang.org&#x2F;page&#x2F;Snit%27s+Not+Incr+Tcl

          1. wduquette · · focus · HN ↗
            Not really. Snit’s included in Tcllib; find the Tcllib docs and look at the Snit man page and Snit FAQ.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.