[e-lang] inconsistencies with __return ejector
toby.murray at comlab.ox.ac.uk
Sun Mar 23 17:39:08 EDT 2008
On Sun, 2008-03-23 at 13:26 -0700, Mark Miller wrote:
> On Sun, Mar 23, 2008 at 1:05 PM, Toby Murra
> > Given that you can't make everyone happy, then it might be best to
> > go with a less subjective measure, rather than "expectations".
> > "Consistency" is perhaps a good objective test to apply here. People may
> > be unhappy but if the behaviour is consistent, then it's easier to
> > justify.
> Yes, that's how we arrived at the current behaviors: treat when-blocks
> like then-blocks and else-blocks.
Actually, now that I think about it, I realise that "use return
pervasively" is not a useful approach as your example illustrated so
The case of match and when blocks have no precedent in other langugaes
like Python or Java anyway so having different behaviour there is not
Further, use of return inside when blocks seems problematic since there
is no invoker to return to.
Match blocks are still an exception that one needs to remember, but that
is easy to fall into the habit of using "return" there. Once you realise
that "match" is Kernel-E but "to" is not, then it becomes easier to
remember not to use "return" in "match" blocks. However, novice
programmers shouldn't need to know this, imo.
More information about the e-lang