def newRef initial  =  {
  def this.value      & state x  =  x  & state x,
      this.update y   & state x  =  () & state y
  this & state initial
}

def newLock = {
  def this.getLock & this.releaseLock  =  ()
  this & this.releaseLock
}
