don't refer to enclosing scope on as_int()
locate() method for debugging purposes
ifelse.evaluate() is aware of expressions which evaluate to the same value on both sides. This makes the optimizer work in cases where evaluating() the condition would fail. Technically speaking, this is working around the evaluate() bug for varying and attribute expressions. In practice, it will be a long time until I implement evaluate() for those cases, so this is needed.
update