|
On 10/03/2009 18:09, Roberto Ierusalimschy wrote:
Somehow, that's another argument for hex escapes: beside the fact we are familiar with them, and are handy, they have the advantage of being of fixed width, so there is no ambiguity: \x0099 will do what you expect.As I just pointed out, this is not true in C. (So, maybe we are not that "familiar" with them after all :)
"will do what you expect" in Lua if such escape is defined with precise semantics (ie. accept two and only two hex digits).
That's what I meant.Semantics of other languages is irrelevant here! ;-) They are important if programmers are familiar with them, but they must not get in a way, and the rule above is simple enough and probably intuitive enough not to break the beloved (?) "principle of least surprise" (surprises can change depending on background of programmer, anyway).
-- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- --