A minor correction:

David Hopwood wrote:
> For example, suppose that the Oz source contains an equality test
> "<variableA> == <expressionB>", where expression evaluates to <valueB>.
> Using pseudo-C notation, this would be compiled to a primitive
> "variableEqualsValue(&variableA, valueB)":
> 
>   bool variableEqualsValue(variable *pvarA, value *pvalB) {
>       value *pvalA = derefVariable(pvarA); /* may block if undetermined */
>       if (pvalA == pvalB) return true;
> 
>       if (valueEqualsValue(pvalA, pvalB)) {
> +         setVariable(pvarA, pvalB);
>           return true;
>       }
>       return false;
>   }

For a language with defined left-to-right evaluation, it is necessary to
dereference <variableA> before computing <expressionB>. This is easy to fix,
by making both the variable's location and its dereferenced value inputs to
the primitive.

-- 
David Hopwood <[EMAIL PROTECTED]>


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to