A calculus for "environment-aware" computation