[e-lang] inconsistencies with __return ejector

Toby Murray toby.murray at comlab.ox.ac.uk
Sun Mar 23 11:23:17 EDT 2008


Hi e-lang,

I'm writing to bring up the issue of the __return ejector and some
potential inconsistencies that surround it.

The essential potential problem is that most new programmers to E will
treat "return" as a statement and thus expect to be able to use it
pervasively. 

I have been tripped up by the following

match [verb, args] {
   return E.call(target, verb, args)
}

which is erroneous since the "__return" ejector is not defined here.

Also, a recent edit to the erights wiki also exhibits this same
confusion. (see
http://wiki.erights.org/w/index.php?title=Walnut/Distributed_Computing&curid=1508&diff=2555&oldid=2512 )

Knowing when "return" can and cannot be used is tricky. It can't be used
within "when" blocks, although the user who made the above edit to the
wiki obviously assumed that it should be used there in order to specify
the value that it should resolve to.

Not being able to use "return" in match and when blocks also seems to
violate the recent 0.9 change that programmers need to explicitly mark
what a block evaluates to. In the case of match and when blocks, the
programmer cannot use "return" to say "Yes, I'm explicitly marking what
this block is evaluating to and, hence, am aware of any authority
leakage it might cause e.g. by exposing a sensitive capability to the
caller etc.".

This all seems a bit inconsistent to me. 

Has it been discussed before? Does anyone else agree? 

At any rate, the wiki edit above needs to reverted and some text added
to explain why "return" shouldn't be used there.

Cheers

Toby



More information about the e-lang mailing list