[e-lang] POLA Considerations in Control Flow (was: ControllingExtent)

Karp, Alan H alan.karp at hp.com
Tue Dec 28 14:32:19 EST 2004

MarkM wrote:
> a) at most one of thenExpr or elseExpr are evaluated,
> b) they are evaluated only once,
> c) they are never evaluated after the conditional expression 
> completes,
> d) the outcome of the expression as a whole is the outcome of
>     evaluating one of these expressions.
I don't think these conditions are exactly right in the presence of
exceptions.  I believe you only considered a problem with pick/2 if
foo() did something strange.  I think (b) should be "they are evaluated
at most once".  You also need to define what "completes" means in (c) if
the conditional expression generates an exception.  I don't know if (d)
is correct if the expression generates an exception.
Alan Karp
Principal Scientist
Virus Safe Computing Initiative
Hewlett-Packard Laboratories
1501 Page Mill Road
Palo Alto, CA 94304
(650) 857-3967, fax (650) 857-7029

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Karp, Alan H.vcf
Type: text/x-vcard
Size: 433 bytes
Desc: Karp, Alan H.vcf
Url : http://www.eros-os.org/pipermail/e-lang/attachments/20041228/3aef9c7f/KarpAlanH.vcf

More information about the e-lang mailing list