Deutsch English Français Italiano |
<87sexvm1lr.fsf@bsb.me.uk> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse <ben@bsb.me.uk> Newsgroups: comp.lang.c Subject: Re: Writing own source disk Date: Sun, 02 Jun 2024 23:17:04 +0100 Organization: A noiseless patient Spider Lines: 29 Message-ID: <87sexvm1lr.fsf@bsb.me.uk> References: <v3hmha$3banl$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 03 Jun 2024 00:17:04 +0200 (CEST) Injection-Info: dont-email.me; posting-host="e02f48bed505247df41ef3632285a916"; logging-data="3719293"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Qe97l6TCalFUDveVKIkWWr1hyYxqjzFA=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:VWNX6Sn6nF2+zKJeI9wqpMjq6Bw= sha1:+XL8GXWFIwSsuSawo6Z4Ww9atQE= X-BSB-Auth: 1.afe50189d096d51750c1.20240602231704BST.87sexvm1lr.fsf@bsb.me.uk Bytes: 2032 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.