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  3946 reads

Browse archivesActive forum topics 
Recent comments
2 hours 16 min ago
2 hours 31 min ago
2 hours 42 min ago
3 hours 16 min ago
3 hours 34 min ago
5 hours 5 min ago
1 day 3 hours ago
1 day 10 hours ago
1 day 20 hours ago
1 day 22 hours ago