[E-Lang] the return of `return'

Darius Bacon darius@accesscom.com
Mon, 18 Jun 2001 11:20:50 -0700


"Jonathan S. Shapiro" <shap@eros-os.org> wrote:
[...]
> Stick to traditional return.
> 
> Make the value of a block be the value returned by the last statement in the
> block -- this was an error in the C design.
> 
> However, make the use of "return" as the termination of a function be
> mandatory. That is, a function should not by default return the value of its
> last enclosing block.

This is the design I was starting from for most of my post --
rereading it I see that that wasn't very clear.  I agree with this as
a design goal for any return expression we might have (and Zooko
thinks it's very important that we have one), but as my post outlined
there are some problems.

-Darius

> I fully understand that my last item is unnecessary if blocks return values.
> However, there is a class of errors that it helps to avoid, and it is one of
> those cases where the rule can be relaxed later at no cost, but not imposed
> later without a break in compatibility.
> 
> 
> Jonathan
>