I'm 14 and I built my own programming language with a "Philosophical Interpreter"
说明与用途
将闭包与类分离为不同的对象类型,消除了自定义语言解释器中方法调度的无限递归。
问题
Infinite recursion during method dispatch caused by closures being treated as part of class behavior.
结果
Separating closures from class behavior prevented infinite recursion and clarified the interpreter’s dispatch logic.
工作流
- 1. Model closures as part of class behavior (std::Behavior).
- 2. Observe infinite recursion when invoking methods that evaluate closures.
- 3. Refactor design: create separate object types for closures and classes.
- 4. Implement a dedicated execution path for closures that bypasses class method dispatch.
- 5. Test method dispatch to confirm recursion is resolved.
证据
I separated closures and classes into two distinct object types. Closures now have their own execution path that bypasses the standard class method dispatch.
- 记录日期: 2026-09-05T17:09:43.949Z