Re: Recursion in C, as told by Kernigan, Ritchie, and Lovecraft

2009-12-17 Thread Bryon Daly
On Thu, Dec 17, 2009 at 5:32 AM, Alberto Monteiro
wrote:

>
> 
> The code is wrong:
>
>  void Cthulhu
>  (int Ia) {
>  if (Ia/10)
>  Cthulhu (IA/10);
>  putchar // ftagn!
>(Ia % 10 + '0');
>  } // neblod zin!
>
> // is a comment in C++ and, by the arcane magic known as backwards
> compatibility, crept into C compilers
> 
>

// comments are part of the C99 standard.  (C1899 in this case, I suppose)

-bryon
___
http://mccmedia.com/mailman/listinfo/brin-l_mccmedia.com



Re: Recursion in C, as told by Kernigan, Ritchie, and Lovecraft

2009-12-17 Thread Warren Ockrassa
On Dec 17, 2009, at 5:36 AM, Max Battcher wrote:

> Beyond that, it doesn't seem like proper Kernigan and Ritchie code because it 
> is not formatted properly in the K&R style... It almost looks more like GNU 
> code.

Well, the sign did declare that the place was called GCC...

--
Warren Ockrassa | @waxis
Blog  | http://indigestible.nightwares.com/
Books | http://books.nightwares.com/
Web   | http://www.nightwares.com/


___
http://mccmedia.com/mailman/listinfo/brin-l_mccmedia.com



Re: Recursion in C, as told by Kernigan, Ritchie, and Lovecraft

2009-12-17 Thread Max Battcher

Alberto Monteiro wrote:

Warren Ockrassa wrote:
I really enjoyed this, but can't share it with my colleagues, since 
they wouldn't get either reference.


Sometimes it's really a pain in the ass to be a programmer and 
English major working in a PR department as the graphics guy.


http://www.bobhobbs.com/files/kr_lovecraft.html



The code is wrong:

  void Cthulhu
  (int Ia) {
  if (Ia/10)
  Cthulhu (IA/10);
  putchar // ftagn!
(Ia % 10 + '0');
  } // neblod zin!

// is a comment in C++ and, by the arcane magic known as backwards 
compatibility, crept into C compilers




Also, there is an undeclared variable (IA != Ia). That was the first 
thing I noticed skimming it.


Beyond that, it doesn't seem like proper Kernigan and Ritchie code 
because it is not formatted properly in the K&R style... It almost looks 
more like GNU code.


--
--Max Battcher--
http://worldmaker.net

___
http://mccmedia.com/mailman/listinfo/brin-l_mccmedia.com



Re: Recursion in C, as told by Kernigan, Ritchie, and Lovecraft

2009-12-17 Thread Alberto Monteiro

David Hobby wrote:
> 
> That is nice.  I'm sure I can find some people
> who'll appreciate both references, and not just
> say that the followers of Cthuhlu should use
> different variable names for clarity.
> 
Maybe we should parody the wikibook on C programming
  http://en.wikibooks.org/wiki/C_programming
into the Uncyclopaedia "mirror":
  http://uncyclopedia.wikia.com/wiki/C_programming_language

Alberto Monteiro


___
http://mccmedia.com/mailman/listinfo/brin-l_mccmedia.com



Re: Recursion in C, as told by Kernigan, Ritchie, and Lovecraft

2009-12-17 Thread Alberto Monteiro

Warren Ockrassa wrote:
>
> I really enjoyed this, but can't share it with my colleagues, since 
> they wouldn't get either reference.
> 
> Sometimes it's really a pain in the ass to be a programmer and 
> English major working in a PR department as the graphics guy.
> 
> http://www.bobhobbs.com/files/kr_lovecraft.html
>

The code is wrong:

  void Cthulhu
  (int Ia) {
  if (Ia/10)
  Cthulhu (IA/10);
  putchar // ftagn!
(Ia % 10 + '0');
  } // neblod zin!

// is a comment in C++ and, by the arcane magic known as backwards 
compatibility, crept into C compilers


Alberto Monteiro, Cthulhu worshipper, C programmer and utterly insane, 
having failing the sanity check many times



___
http://mccmedia.com/mailman/listinfo/brin-l_mccmedia.com