Return Isn't Transparent

Neal Gafter neal at gafter.com
Sat Jul 17 10:15:07 PDT 2010


On Sat, Jul 17, 2010 at 6:46 AM, Howard Lovatt <howard.lovatt at gmail.com>wrote:

> A return statement isn't transparent. This is well articulated in
> Principles of Programming Languages R. D. Tennent (I don't have a copy
> handy - but I think page 56 is one such place). Consider:
>
> int m() {
>  return 42; // To be wrapped in a lambda
> }
>
> Then imagine that you could create a lambda that encapsulated the long
> return and you called it:
>
> int m() {
>  { -> return 42; }.();
>  // Oops error - must return value from m
> }
>

This works just fine in BGGA.  The language can indeed be designed so that
return is transparent.


More information about the lambda-dev mailing list