Scratchpad r76 (See the current copy)
- Random Demonstrations
- Random Diatribes
- Random Links
- Information about interesting Current Projects
- Information about Threads
- My Scratchpad
- Information about Tcl
- Information about Roy Keene
- Random Scripts
- Information about Random Number Generation
Feel free to contact me about this website at mailto:wiki@rkeene.org
- My Friends
What you will find here
LOLCODE in Tcl
Implementing the LOLCODE Language in Tcl
Example LOLCODE [1] program:
HAI CAN HAS STDIO? VISIBLE "HAI WORLD!" KTHXBYE
It should be obvious that this is syntactically valid Tcl. Thus we just need to implement the grammar.
proc HAI {} {
# No initialization required
}
proc CAN args {
# XXX: Incomplete implementation
}
proc VISIBLE {str} {
puts stdout $str
}
proc KTHXBYE {{ret 0}} {
if {$::tcl_version eq "8.5"} {
return -level 2 $ret
} else {
# Best approximation available in Tcl earlier than 8.5
exit $ret
}
}