3 ms·
Not directly a quine per se, but suppose you want to write a computer program which writes computer programs. And you want all these programs (both the one writ
by xamuel 6y ago
Not directly a quine per se, but suppose you want to write a computer program which writes computer programs. And you want all these programs (both the one writing them, and the ones written) to be 100% self-contained, no importing from a util file or anything like that. Then if a util function shall be used in the writing program as well as in the written programs, then it'll need to be "injected" into the written programs in a Quine-like way.
Here's an extreme example, a program which writes programs, each of which writes programs, each of which writes programs, ..., each program being fully self-contained: https://raw.githubusercontent.com/semitrivial/ions/master/src/LevelOmega/standalone/w%5Ew.py https://raw.githubusercontent.com/semitrivial/ions/master/sr...
(For the context behind that program, see: https://github.com/semitrivial/IONs https://github.com/semitrivial/IONs)