User loginNavigation 
Depends on what "is" isSounds like B. Clinton's evasive (but syntactically correct) answer to some deposition. But it's just a little lesson in associativity. We want "is" to be synonymous with "=". That sounds reasonable, right? We could do this at the lowest level, at the lexer, and really make things simple. But here comes "not". It's already an operator, and you want it to be so. And in (my) typeless world, "not" operates on integers just as happily as it does on booleans. There are two reasonable implementations for "not" on integers: multiplying by 1 or the function y = 1  x. The first is sort of intuitive, the second makes not(1) equal to 0 and not(0) equal to 1. Either way, you lose. Choose the first, so "not x" => 1 * x and examine the expression 0 is not 0 You'd want this to be a false statement, but unfortunately, it might parse like this: 0 is (not 0) Yikes! Tell me that this is just an LL(2) thing and if I look ahead one more token I'll be OK. What I mean by that is: is my hack a canonical hack? When I see "is" I just greedily look ahead to see if the next token is "not". By andrewzboard at 20100202 01:00  LtU Forum  previous forum topic  next forum topic  other blogs  3711 reads

Browse archivesActive forum topics 
Recent comments
4 days 19 hours ago
5 days 1 hour ago
5 days 18 hours ago
6 days 1 hour ago
6 days 3 hours ago
6 days 8 hours ago
6 days 13 hours ago
6 days 14 hours ago
6 days 17 hours ago
6 days 19 hours ago