[Richard Suchenwirth] 2003-03-20 - "Titoo" is a fancy spelling for T2, which is a language that doesn't exist (yet), but I started thinking about it this morning. Somehow like non-Euclidian geometry evolved by just changing one of the Euclidian axioms, the idea was of a language almost like Tcl, with one difference: "A command is evaluated in two steps. First, the Tcl interpreter breaks the command into words and performs substitutions as described below. These substitutions are performed in the same way for all commands. The '''second''' word is used to locate a command procedure to carry out the command, then all of the words of the command are passed to the command procedure." (Tcl has "the first word" - hence the name T2). The second position facilitates implementation of infix operators, in a way it's coming closer to [APL], but without limiting the number of arguments to 2 maximum. An exception would be if a command consists only of one word: then that of course is the name of the command, as it is in Tcl - so for instance [break], [continue], [return], [exit] would need no changes. Just to get a feeling for that, here are some Tcl and T2 commands in comparison: set i 0 | i set 0 incr i | i incr Obviously, the [set] command would in T2 better be called "="... and [incr] "++"? | i = 0 expr 1 + 2 | 1 expr + 2 This is pretty silly - better release [expr]'s operators from their dungeon, like many have done locally - a + command would add its first operand (to the left) with the second (to its right): + 1 2 | 1 + 2 expr {1+2}*{3+4} | [1 + 2] * [3 + 4] Like Tcl, T2 would have no operator precedence rules - explicit grouping would be required. Some virtual code snippets how T2 might look: .. cd fp = myfile.txt open w fp puts "hello, file" fp close sum proc args { res = 0 i in $args {res += $i} res = } sign proc x { {$x > 0} ? 1 : {$x < 0} ? -1 : 0 } fac proc x { {$x < 2} ? 1 : {$x * [[x --] fac]} } i in [1 .. 10] {- puts $i} Hmm.. what do y'all think? ----