lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


"Reuben Thomas" <rrt@dcs.gla.ac.uk> writes:

> Well, if you're going to use imperative languages, this is the sort of
thing
> you sometimes have to put up with to get good performance! But I agree
that
> 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
hide
> 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
to right.

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....

Jay