p j wrote:
> If it is incredibly complex to implement then I agree
> it is not worth it, but it seems odd and unwelcome,
> that a sentence fails but partially creates a side
> effect.

Hmm...

Personally, I am aware of these issues, and I try to
address them at a design level.  To me, good programming
style means code is immune to these kinds of problems.

One approach simply requires that nothing happens on a
line after a side-effect.  This would apply regardless
of whether the side effect is a changed name, a changed
display, a changed file, a transmitted message, etc.

Another approach relaxes this constraint for names whose
values are temporary (created afresh every time the code
is restarted).  

Another approach goes beyond the single-line view and 
tries to ensure wherever possible that a sequence of
lines may be arbitrarily interrupted and restarted.

Restartability seems useful in debugging, in communications,
and in any area where there's some uncertainty about
being able to successfully complete a task.

Sometimes, though, it's better to allow small windows
of opportunity where restarting is problematic.  In
some applications, a best effort approach works better
than a more heavy-handed approach.

And, I feel like I ought to say something about race 
conditions, but that's different enough that I should 
probably just leave it alone.

Thanks,

-- 
Raul

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to