[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Specifying expression evaluation order
- From: "Jay Carlson" <nop@...>
- Date: Mon, 20 Aug 2001 13:57:54 -0400
"Reuben Thomas" <email@example.com> writes:
> Well, if you're going to use imperative languages, this is the sort of
> you sometimes have to put up with to get good performance! But I agree
> specifying this sort of thing gives much better language semantics, while
> not degrading performance much most of the time (and in Lua that shouldn't
> matter anyway). However, evaluation order should not (in most cases) be
> relied on; it's almost always bad style. Having it fully specified can
> bugs as much as prevent them.
Which reminds me of a proposal I saw once for deterministic evaluation order
that discouraged explicit dependencies:
If there are an even number of arguments, evaluate all the even numbered
arguments left to right, then evaluate all the odd numbered arguments left
If there are an odd number of arguments, evaluate them all right to left.
Simple, well defined, and guaranteed to annoy people into not intentionally
depending on it....