Execute HQ9+/Tcl: Difference between revisions
m
Fixed syntax highlighting.
m (Add SMW link) |
m (Fixed syntax highlighting.) |
||
Line 4:
{{works with|Tcl|8.4}}
<br clear=right>
===Interpreter===
<
for {set i [set a 0]} {$i<[string len $d]} {incr i} {
switc\u0068 -- [string index [string tolower $d] $i] \u0068 {
Line 19:
}
} \x2b {incr a}
}</
===Compiler===
To be fair, this compiler then immediately executes the code. Replace the <code>eval</code> with <code>puts</code> to see what it generates.
<
eval [string map [list \u0068 {puts "\u0048ello, world!";} q \
[list puts -nonewline $d]\n \071 {for {set b [expr 100-1]} 1 {} {
Line 32:
if {$b} {puts ""} else break
};} \x2b {incr a;}
] [regsub -all {[\u0000-*,-8:-gi-pr-\uffff]*} $d {}]]</
|