Scratchpad r73 (See the current copy)
- Random Diatribes
Feel free to contact me about this website at mailto:wiki@rkeene.org
- Information about Threads
- Information about interesting Current Projects
- My Scratchpad
- Information about Tcl
- Random Links
- Random Scripts
- Random Demonstrations
- Information about Roy Keene
- My Friends
- Information about Random Number Generation
What you will find here
Tcl Quine
A Quine [1] is a program that produces its code as output. Quines can be written in almost any language. Gary P. Thompson II has a large collection of quines [2] [3]
Below is a very simple to understand quine written in Tcl
#! /usr/bin/env tclsh
proc MySelf {} {
puts {#! /usr/bin/env tclsh}
puts {}
puts -nonewline "proc MySelf {} {"
puts -nonewline [info body MySelf]
puts "}"
puts ""
puts "MySelf"
}
MySelfTest