Generalize the Python procedure to recursively replace compiler/interpreter.