matthew-mojira / cicero

GNU General Public License v3.0
0 stars 0 forks source link

Recursive boxes #7

Closed matthew-mojira closed 7 hours ago

matthew-mojira commented 2 days ago

The following program hangs

{
  var x = box 1
  x <- x
  x?
}

Should this be an Error?

matthew-mojira commented 7 hours ago

Recursive boxes should be allowed, because it might be useful in implementing cyclic data structures. For simplicity's sake, the single cycle should be allowed.

The real solution is that the box type itself should not be recursive. Because the language is dynamic and the contents of the box is mutable, the type of a box can change, which doesn't really make sense.