[E-Lang] Syntax change: reducing side-effects

Bill Frantz frantz@pwpconsult.com
Sun, 11 Feb 2001 21:29:17 -0800


I like the idea.  Kind of like making Java names default to final.

At 2:38 PM -0800 2/11/01, Dean Tribble wrote:
>- For defining occurrence without the 'var' keyword, the guard is always
>and only a ValueGuard.  If absent, the guard defaults to the ValueGuard,
>':any'.  It can be translated into Kernel E as always being wrapped with a
>'final' SlotMaker.  The compiler must statically reject assignments to
>names defined without 'var'.
>
>- For defining occurrences that are prefixed with the 'var' keyword, the
>guard is always a SlotGuard.  If absent, it defaults to ':settable'.
>
>- User-defined SlotGuards can only be used with a 'var' prefix.  As a
>result, the reader of the code (including a compiler) is guaranteed that
>unless there is a 'var' prefix, the value of the variable will only ever be
>the initial value (i.e., user-defined SlotGuards can allow assignments).

I assume that user defined ValueGuards can be used with "define"d names.  I
have always thought guards made a good form of "assert" statement.


I can think of a few kludges to deal with the edit/compile/test cycle.  Is
there an elegant solution?

Cheers - Bill


-------------------------------------------------------------------------
Bill Frantz       | Microsoft Outlook, the     | Periwinkle -- Consulting
(408)356-8506     | hacker's path to your      | 16345 Englewood Ave.
frantz@netcom.com | hard disk.                 | Los Gatos, CA 95032, USA