i tried to write a self-replicating program ("quine") in raw (no macros) GNU nroff
. Admittedly, this is pointless and eccentric, but it doesn't seem to have been done before. I have failed to do so.
I'm pretty sure that whoever succeeds in writing a no-macro nroff
input language quine will need to define strings, or macros or "boxes". To do that you need to write requests like:
.as s "just assigned this to string s
.de xxx
.nop "\*s"
..
.xxx
That is, every request in nroff
input has a '.' at the start of the line.
Since quines just output their source code (without cheating), the output probably has to have '.' as the first character of several output lines.
How on earth do you get GNU nroff
to output a '.' character at the start of a line? No amount of indirection or escaping can do it, as far as I can tell. Is there some hidden request that outputs a '.' at the start of a line?
I'm using recently synced Arch Linux, which has Groff 1.22.3 installed.