lua-users home
lua-l archive

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

I have done a lot of programming with an integrated application/database
called 4D (  It has a very useful variation on case

Case of

:(a = b)
    b = b+1

    a = a+1

   a = 0

end case

The comparisons are independent of a specific variable, and as shown by
the second example, statements within the comparison are evaluated.  This
is extremely useful in handling multiple independent conditions (state
machines, priorities, pre-requisites).  The (very minor) drawback is that
there is no fallthrough/leap ahead feature, so each comparison gets
evaluated until one comes back true.  In a programming language like C I
can understand the need to have a fixed set of comparisons, but in an
interpreted language like Lua and 4D, I believe having extended
flexibility for comparisons has greater value than adhering to various
programming philosophies that argue counter to it.


Gregory T. (tim) Kelly

"Anything war can do, peace can do better."  -- Bishop Desmond Tutu