Sujet : Re: Writing own source disk
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 03. Jun 2024, 14:50:10
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3khmh$3te36$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 03/06/2024 13:37, bart wrote:
On 03/06/2024 12:58, Ben Bacarisse wrote:
What part are you objecting to?
That it is not very interesting. Using #embed applied to a program's only source code I think opens up some intriguing possibilities.
Whereas a pure quine, which can require ingenuity, to me is just a puzzle.
If I look at examples on sites like this:
https://rosettacode.org/wiki/Quinethen a common characteristic is that the a lot of source code ends up being written twice. To me that is undesirable.
It's also not clear how easily arbitrary code (ie. that performs some useful task) can be added.
This is one that /I/ would consider cheating:
#include <stdio.h>
main(void){printf(__FILE__);}
Here, the source must be put into a file with the same name as the source code, that is, called:
#include <stdio.h>\nmain(void){printf(__FILE__);}
But this is also writing it twice: once inside the file, again as the filename.