.BG
.FN synchronize
.TL
Synchronize Datasets
.CS
synchronize(reset=FALSE, assign=TRUE, data=TRUE)
.AG reset
should the current expression be terminated after synchronizing?
.AG assign
should pending assignments be committed?
.AG data
should the internal cached objects (typically, function definitions) be
thrown away?
.SE
The internal contents of the evaluator are made consistent with the external
databases, according to the arguments given.
This takes place immediately, not at completion of the current expression.
So, in particular, assignments are committed right away if `assign' is `TRUE'.
The `data' argument refers to a table in memory of kept objects.
Unde normal use, this table is entirely transparent: the objects seen
by the S user are exactly the same, regardless of whether they were
retrieved from this  table or not.  Calling synchronize absolutely
forces this to be true, by clearing out the table.

There are two situations in which `synchronize' is needed.
If you are doing a long computation iteratively (for example, using
`browser') and want to ensure that permanent assignments will  be
committed now, regardless of any error you may make in the future,
`synchronize(assign=T)' does that.
On the other hand, if you know or supspect that some
.I other
process than your own S session may have modified some object that
could be in the keep table (for example, if you edit a function in one
window that you are using in another), then `synchronize(data=T)' is
needed.
.EX
# select datsets to remove, break to get out
assign.and.write <- function(name,value,now)
{
	assign(name,value,w=1)
	if(now)synchronize(assign=T)
}
.KW programming
.WR
