
Dear Sean,
In message 8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b@gmail.com you wrote:
For a partial list, see
Whoops, looks like I completely misread what you were asking here. I don't have an exhaustive list of differences, but here are some similar things expressed in both languages:
sh tcl
foo=bar set foo bar echo $foo echo $foo
if [ 1 -gt 2 ]; then if {1 > 2} { echo a echo a else } { echo b echo b fi }
foo() { proc foo {first second} { echo $1 $2 echo $first $second } }
for file in $(ls *.c); do foreach file [glob *.c] { echo $file echo $file done }
fact() { if [ $1 -eq 0 ]; then echo 1 else echo $(($1 * $(fact $(($1 - 1))))) fi }
proc fact {n} { if {$n} { expr {$n * [fact [expr {$n - 1}]]} } { return 1 } }
Hopefully this gives you a bit of a feel for the basic differences.
Well, I know TCL, and there has been a zillion of reasons to move _from_ that language many, many years ago. Intoducing this as new "shell" language in U-Boot does not look attractive to me. Actually, it gives me the creeps.
Best regards,
Wolfgang Denk