Deutsch English Français Italiano |
<v3iu2s$3i7bf$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Malcolm McLean <malcolm.arthur.mclean@gmail.com> Newsgroups: comp.lang.c Subject: Re: Writing own source disk Date: Mon, 3 Jun 2024 00:09:15 +0100 Organization: A noiseless patient Spider Lines: 40 Message-ID: <v3iu2s$3i7bf$1@dont-email.me> References: <v3hmha$3banl$1@dont-email.me> <87sexvm1lr.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 03 Jun 2024 01:09:16 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b36d89b667afdbeffd80b8ba94bee435"; logging-data="3743087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18C18MT4V1ClCRu50X6VRrx4D7lcnkz0/g=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Gg94qwshg7jo6a5PfVt3+7igdfE= Content-Language: en-GB In-Reply-To: <87sexvm1lr.fsf@bsb.me.uk> Bytes: 2653 On 02/06/2024 23:17, Ben Bacarisse wrote: > 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? >The FileSystem XML fie is embedded with the program. It is a genuine quine. Compile it and see. It's also a very superior quine, and it spits out images and binaries. You can't generate a FileSystem XML file with portable ANSI C, and you can' write one out to a disk. But eveything else is done portably, and it is a portable quine. -- Check out Basic Algorithms and my other books: https://www.lulu.com/spotlight/bgy1mm