lua-users home
lua-l archive

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

David Given wrote:

>Is there any real point trying to
> optimise if...elseif...elseif...end sequences?

I've started to think not, although I argued in favor initially of
expanding a case/switch statement.  The discussion of dispatch tables
suggests that fast lookups of conditionals can be handled that way (and
I've used it as such for getting references to functions through table
lookups), and the if-then-elseif can handle dynamically evaluating
conditional arguments (function returned results) already.

Since this appears to be a recurring topic, perhaps the FAQ could be
updated to outline this discussion?  (yes, I volunteer if needed)


Gregory T. (tim) Kelly

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