[E-Lang] the return of `return'

zooko@zooko.com zooko@zooko.com
Tue, 19 Jun 2001 18:26:34 -0700


 Dean Tribble wrote:
>
> >I advocate making ":retAny" the default guard, which means that by default no
> >capabilities can leak from the function without an explicit return.  However,
> >automatically returning the last expression can be very useful or elegant, so
> 
> Do you have some good examples?  Are they sufficiently compelling to 
> motivate a difference from common practice?

Hm.. actually this isn't my style -- I would tend to use `return' consistently.
But I had the impression that other people valued being able to automatically
return the last expression from a function.  If so, I suppose they will speak
up now...


> >I advocate that you can explicitly specify e.g. an ":expSafeRabbit" guard to
> >allow such values, but with coercion to "safe rabbit" by the guard.
> 
> I can't actually tell if this is sarcasm or an actual proposal :-)  In any 
> case, it is sufficiently far out that it doesn't sound worth the conceptual 
> expense.

Oh, this might be my mistake, but I thought that E already had a notion of
arbitrary programmable "guards" which enforced, at runtime, some
safety/correctness property of the return value.  My original proposal of
":retAny" (and its expression-style counterparty ":expAny") was intended to be
an implementation of return-style on top of this arbitrary guard feature, but 
I didn't realize that my proposal didn't actually cause immediate exit upon a
`return', until Darius and Dean pointed that out and fixed it.

So the ":exp" part of ":expSafeRabbit" is a serious proposal, in case automatic
returning of the value of the last expression is needed.  The "SafeRabbit" part
was a silly example of an application-specific guard.


Regards,

Zooko