Open umajho opened 1 year ago
靠着 LazyValue 记忆求值结果,并且到处传入 reevaluate 有些难以跟上。 目前的想法是改成用 Map<Node, Concrete | false> 记忆针对 Node 的 interpret 结果。false 代表对应 Node 求值的结果多变,因此不会记忆曾经的求值结果。
LazyValue
reevaluate
Map<Node, Concrete | false>
interpret
上面设想的机制不能替代原先的记忆化机制。后者已从其他方面进行重构(https://github.com/umajho/dicexp/commit/039fa7a1123af072d51ed1e0254e233134ec2a59)。
未来可以考虑用上面的机制记录字面量的求值结果,但优先度不是很高。
靠着
LazyValue
记忆求值结果,并且到处传入reevaluate
有些难以跟上。 目前的想法是改成用Map<Node, Concrete | false>
记忆针对 Node 的interpret
结果。false 代表对应 Node 求值的结果多变,因此不会记忆曾经的求值结果。