The Declaration Approach (was: Some thoughts on the 'reveal' operator)

Douglas Crockford crock@communities.com
Thu, 21 Oct 1999 12:25:34 -0700


> >The more I hear, the more I like:
> >
> >      def square(x) reveals {x*x}
> >
> >(Or perhaps)
> >
> >      to square(x) reveal {x*x}
>
> Ok, it's still in the running.  In fact, at the moment, it's the only
concrete proposal left in the running.  However, you bring up an interesting
problem above.  E has both methods and functions.  I *really* don't want to
introduce both "reveal" and "reveals".  Depending on which way we go, we'd
be stuck having to live with one of
>
>       def square(x) reveal {x*x}
> or
>       to square(x) reveals {x*x}

Perhaps the answer is provided by harnessing the power of our friend, The
Gerund:

        def square(x) revealing {x*x}
and
        to square(x) revealing {x*x}