我想知道为什么这没有在 GNU Smalltalk 中终止:
s := Set new. s add: s
理论上,s
应该只是一个包含空集的集合。但是执行它只会永远循环,炸毁堆。
有趣的是,
((s := Set with: 4 with: 5 with: 6) add: s) size.
终止并评估为 4。
我想知道为什么这没有在 GNU Smalltalk 中终止:
s := Set new. s add: s
理论上,s
应该只是一个包含空集的集合。但是执行它只会永远循环,炸毁堆。
有趣的是,
((s := Set with: 4 with: 5 with: 6) add: s) size.
终止并评估为 4。