POV-Ray : Newsgroups : povray.off-topic : Computer language quirks : Re: Computer language quirks Server Time
29 Jul 2024 20:28:27 EDT (-0400)
  Re: Computer language quirks  
From: Invisible
Date: 3 May 2011 04:43:33
Message: <4dbfc035$1@news.povray.org>
On 02/05/2011 18:26, Darren New wrote:
> I find it mildly distracting that I can't do this:
>
> void xyz() { ... }
>
> void abc()
> {
> if (...)
> return xyz();
> else blah blah blah;
> }
>
> I can do it if xyz and abc return values, but not if they don't. I have
> to instead
> if (...)
> {
> xyz();
> return;
> }
>
> which significantly expands a function that has lots of such dispatches.
> It also makes it unclear to the casual reader that this is a tail call.

How about just

   if (...)
   {xyz(); return;}
   else...

That's slightly less load.

Of course, The Real WTF is "functions" that return void. ;-)

> Also, I realized I tend to have larger functions than necessary because
> most languages I'm using don't let me nest functions.

No comment. ;-)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.