Some thoughts on the 'reveal' operator

Douglas Crockford crock@communities.com
Wed, 29 Sep 1999 14:02:20 -0700


Mesa had a construct that might be useful here: named return parameters.

A procedure definition could look something like

        foo: PROCEDURE (arg ...) RETURNS (result)

result looked just like a local variable, except that it would be passed
back to the caller when the procedure returned. I especially liked that
there could be more than one return parameter,

        swap: PROCEDURE (argOne, argTwo) RETURNS (resultOne, resultTwo) {
                    resultOne := argTwo;
                    resultTwo := argOne;
        }

        a, b := swap (a, b);