Quick'n'dirty

Difference between version 16 and 17 - Previous - Next
Purpose: show some solutions-on-the-fly. Try all cruelties to this language you can imagine!

Rationale: some days I feel unhappy if there is no occasion to do something quick'n'dirty. (The rest of the year, I'm a nice guy.)

   * [Search Engine in Javascript]
   * [Batch Converter ogg2mp3]
   * [Pils]
   * [txt2html (q&d)]
   * [Expansion with {*} in Tcl 8.4]

----
[wdb] In earlier years for my project [One Hand Content] there was no [lassign] yet. Thus I made a Lisp-style let, also minimalistic style:

 proc let args {uplevel foreach $args break}

It works as follows: the call

 let {a b} {apple banana}

expands to 

 foreach {a b} {apple banana} break

with side-effect that variables a, b are set.

How to swap variables:

 let {a b} [list $b $a]

which expands to

 foreach {a b} {banana apple} break

Benefits: no infix syntax introduced, just pure Tcl styled polish notation (German: Polnische Notation).
----
[[Do you play Tina Turner while coding?]] -- ''No,'' as long as I'm coding, there is no music necessary.
<<categories>> CTcl Hategorycks