Re: freeze/2 and nb_setarg/3 interaction

Jan Wielemaker <[email protected]> Tue, 15 Apr 2014 09:17:58 +0200
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 15-04-14 00:16, Richard A. O'Keefe wrote:
> To summarise the thread:  nb_setarg/3 is broken by design and it is
> not obvious that an affordable non-broken variant is possible or even
> what it would mean for it not to be broken.

The same issues apply for global variable, but these are necessary
for e.g., CHR.  I won't say these things are broken.  Just, they are
non-logical and require some understanding.  So, non-backtrackable
assignments after backtrackable ones are only non-backtrackable
in the `time' interval after the last backtrackable assignment.
Fair enough as far as I'm concerned.

> Sometimes, Quintus were just *brilliant* in what they left out.

Yes, these operations destroy the nice and clean language properties.
On the other hand, they allow for algorithms that would get even
uglier without.  In a sense, they should only be used by people
who know what they are doing and use these things to create functionality
that is nice and clean on the outside.  That is not new.  Attributed
variables are also pretty rough.

The downside here is that it is destructive assignment is sooooo
attractive to newcomers :-(

	Cheers --- Jan