
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

(a) (λx. λy. y x) 5 (b) (λx. λy. y x) 5 (λz.z + 3) (c) (λx. λy. x y) (λz.z + y) 7 (d) (λy.(λx. λy. x y) (λz.y z) 7) (λx.x + 1)
int apply_twice (int (f) (...), int x) { return f(x); } int twice (int (g)(...), int y) { return y + apply_twice(g, y); } int foo(int x) { return x + x; } int main() { return twice(foo, 5); }