On 2/28/2013 6:48 AM, Ary Borenszweig wrote:
On 2/28/13 1:57 AM, Walter Bright wrote:
On 2/27/2013 8:01 PM, John Colvin wrote:
Why must sentinel be known at compile time? I don't see what's in the
way of it
being a runtime argument.

Performance!

It should be usable as a case in a switch statement.

Isn't it possible for the optimizer to inline the function call and then combine
the next ifs?

if (isSentinel(value)) {
} else {
   switch(value) {
   case ...
   }
}

1. I don't know of any C compiler that would do that.

2. There are other cases, as I pointed out to deadalnix.

3. You still can't do lookahead without extra checks

Once again, guys, have a look at lexer.c at the lines I pointed out.

Reply via email to