Talk:Quine: Difference between revisions

→‎C quine: new section
(→‎Haskell evaluation: new section)
(→‎C quine: new section)
Line 62:
 
If you're going to allow an expression that evaluates to itself, won't "blah" evaluate to "blah"? For that matter \x.x will evaluate to \x.x [[Special:Contributions/71.176.132.192|71.176.132.192]] 20:35, 26 April 2011 (UTC)
 
== C quine ==
 
I removed some comments about style about the C quine: it's a bit silly to be serious about good coding style for this subject. If you want properly indented, properly typed and properly header'ed C code, here you go:<lang c>#include <stdio.h>
int main(void){
char*p="#include <stdio.h>%cint main(void){%c%cchar*p=%c%s%c;%c%cprintf(p,10,10,9,34,p,34,10,9,10,9,10,10);%c%creturn 0;%c}%c";
printf(p,10,10,9,34,p,34,10,9,10,9,10,10);
return 0;
}</lang> which does require a trailing newline, btw. Being "more correct", It definitely does not help one read or understand the code. --[[User:Ledrug|Ledrug]] 03:53, 1 September 2011 (UTC)
Anonymous user