Skip to content
Prev 22072 / 63424 Next

validity testing as part of '@<-'

On 9/21/2006 5:29 PM, Parlamis Franklin wrote:
Often changing a single slot puts the object into a temporarily invalid 
state; others need to be changed consistently before it could pass the 
validity test.

Perhaps you could handle this case by wrapping all the calls in some 
sort of wrapper, e.g.

atomic( {obj at slot1 <- 1
          obj at slot2 <- 2 })

but requiring that would break tons of existing code, and turning on 
validObject tests everywhere would slow things down a lot.  Isn't it 
easier to just sprinkle a few more validObject() calls into your code?

Duncan Murdoch