Some thoughts on the 'reveal' operator
Dan Bornstein
danfuzz@milk.com
Fri, 24 Sep 1999 12:06:12 -0700 (PDT)
Bill Frantz:
>I like this solution the best. I would like to figure out a way to only
>have to code reveal at the highest level, while still retaining the
>"explicit revelation only" feature. If we allow:
>
> define factorial(n) {
> reveal if (n <= 1) {
> 1
> } else {
> n * factorial(n-1)
> }
> }
>
>To mean reveal the value of the if expression, we are there. What kind of
>trouble does considering the if to be an expression with a value cause?
>What other problems does the introduction of this pattern cause? The
>Algol68 experience seems relevant here.
I think the problem with this is that when the example is expanded into
non-trivial code, the fact that the result of the if as a thing being
revealed may be lost:
reveal if (...) {
... a page of code here ...
1
} else {
... a page of code here ...
<inadvertent-dangerous-capability-revealing-expression>
}
-dan