A metaquine is a program which is not a quine, but whose output, when run as a program in the same language, is a quine.
The goal of this challenge is to write a metaquine. This is code-golf, so shortest code wins, with earliest answer used as a tiebreaker. Note that only full programs are acceptable, due to the definition of a quine.
Rules for Quines
Only true quines are accepted. That is, you need to print the entire source code verbatim to STDOUT, without:
- reading your source code, directly or indirectly.
- relying on a REPL environment which just simply evaluates and prints every expression you feed it.
- relying on language features which just print out the source in certain cases.
- using error messages or STDERR to write all or part of the quine. (You may write things to STDERR or produce warnings/non-fatal errors as long as STDOUT is a valid quine and the error messages are not part of it.)
- the source code consisting purely of literals (whether they be string literals, numeric literals, etc.) and/or NOPs.
Any non-suppressible output (such as copyright notices, startup/shutdown messages, or a trailing line feed) may be ignored in the output for the sake of the validity of the quine.
Example
Ignoring the rule which forbids literal-only programs and built-in quining, this would be a metaquine in Seriously:
"Q"
The program consists of the single string literal "Q"
, which is implicitly printed at output. When the output (Q
) is run, it is a quine (Q
is the built-in quine function).
T
is an easy 1-byte Pyth answer. \$\endgroup\$