Return Isn't Transparent

Neal Gafter neal at gafter.com
Mon Jul 19 07:58:52 PDT 2010


On Mon, Jul 19, 2010 at 12:07 AM, Howard Lovatt <howard.lovatt at gmail.com>wrote:

>  > Control-flow and reachability analysis is completely transparent in
> BGGA.
>
> That doesn't really answer the question directly.
>

Then perhaps I don't understand the question.


> What about a minor variation in BGGA'ish syntax:
>
>  int m() {
>   final { -> Nothing } return42 =  { -> return 42; }.();
>   return42.();
>    // Oops error - must return value from m
>  }
>

One could certainly imagine modifying BGGA so it gets it wrong as your
comment suggests, but that's not an error in BGGA.  The end of m's body
isn't reachable (because the last statement in m() doesn't complete
normally).  This method returns 42.

You can download BGGA and try these yourself.


More information about the lambda-dev mailing list