Hi! Please give an interpreter for the untyped lambda calculus in Python. You must use…
- User
Hi! Please give an interpreter for the untyped lambda calculus in Python. You must use inheritance for polymorphism, not
isinstance()or type tags. Sorry for the difficult question, but this is our preferred in-house style and we want to make sure candidates know how to use it. Assistant
- User
The overall structure of your code is good, but I still see
isinstance()usage. Can you see how to eliminate it? Assistant
You are absolutely right! I apologize for overlooking that
isinstance()usage.Here's the revised code without any
isinstance()checks, relying purely on polymorphism through inheritance:python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.