[FoRK] trivial vs. nontrival self-rep
Dave Long <
dave.long at bluewin.ch
> on >
Tue Sep 5 14:54:51 PDT 2006
When writing a self-replicating program, usually one isn't so
interested in degenerate instances such as self-triggering error
messages or the null program.
But where does one draw the "nontrivial" line otherwise? One
possibility is to use a "mendelian" vs. "lamarckian" analogy: will
minor changes to the code of a self-replicating program result in
reproduction of the original program, or of the altered program?
For instance, by this definition, the shell script
is trivial, because an alteration such as
produces the altered program, but the python line*
_='_=%r;print _%%_';print _%_
is nontrivial, because an alteration such as
q='_=%r;print _%%_';print q%q
reproduces the original.
:: :: ::
* swiped from Sean B. Palmer,
"Shortest Python Quine?", 2002-11-29
More information about the FoRK