Atomicity of builtins (was: Weakdictionary diffs)

Raphael Collet raph at info.ucl.ac.be
Wed Mar 3 15:16:35 CET 2004


Guys,

Let me restate the problem, and suggest what to do for the upcoming
release.


1. The problem

Christian made a remark about the order of arguments in some builtins,
which sometimes differs from what the Oz programmer sees.  The typical
example of this is Exchange, which is not a function, but is defined in
terms of a functional builtin:

   Exchange = proc {$ C Old New} Old = {Boot_Cell.exchangeFun C New} end

This definition is semantically *correct*, as it separates the atomic
exchange itself from the unification of the output with the
corresponding argument (Out).  It is perfectly possible to implement the
same builtin, with the arguments in the same order as Exchange.  The
main difference is that the unification following the atomic exchange
must be generated by the builtin (with the "REPLACEBICALL" stuff)
instead of the compiler.  This is necessary to keep the same semantics.

So the issue is really about style, code clarity and documentation. 
There is no semantic issue in this case.  For the sake of
maintainability, the implementation should be as simple and uniform as
possible.


2. Suggested strategy

Kevin and I suggest to keep things safe.  Some real bugs have been fixed
recently.  Let us keep the other changes for after the release.  The
packaging process is much more important.


Cheers,

raph



More information about the mozart-hackers mailing list