lua-users home
lua-l archive

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

> Feature detection is sometimes more actionable than version detection.

I second this.

First while this is a nice puzzle / brain teaser, I'd discourage anyone from actually doing such thing in production code. First like Pierre said, if you are detecting behaviour/ features it's all cool, just leave the switches that way instead of projecting them on version numbers.

Secondly, this code is not future safe at all. For example Lua 6.0 might detect as 5.1, who knows.

Lastly if you don't trust the environment you are run in, you already lost by the overall design concept.