Sujet : Re: Writing own source disk
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.cDate : 02. Jun 2024, 23:17:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87sexvm1lr.fsf@bsb.me.uk>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13)
Malcolm McLean <
malcolm.arthur.mclean@gmail.com> writes:
Writing a prgram which writes its own source to standard output is a
standard programming problem. It's called a quine.
A quine must also not process any input.
And I have achieved a
quine. But a serious quine. Not contrived special purpose code, but serious
codde which can be used to package up source for real.
You XML-producing program may be very useful, but it's not really a
quine, serious or otherwise.
And it's completely
portable ANSI C. So of course it can't write output to disk - that is
impossible to achive portably. Instead it writes its own source to standard
output using a simle XML format called FileSystem, which represents the
source tree.
That sounds as if the program reads input (but it's not explicitly
stated) as well as not producing the program text but some XML
representation of the program text. That would make it not a quine for
two reasons.
How do you process a source tree in completely portable ANSI C?
-- Ben.