Re: A New Revealation: Semi-Permeable Membranes Chip Morningstar (
Mon, 25 Oct 1999 21:20:53 -0700 (PDT)

MarkM sez:
>What do you get when you cross Chip's "^" syntax with Bill & Norm's memories
>of Algol68? A more expressive way to say whether a value is returned.
>To start with the punch line, here's the old getterSetterPair()
> rewritten
>using the syntax I'm proposing:
> define getterSetterPair(value) ^any {
> define getter() ^any { value }
> define setter(newValue) ^void { value := newValue }
> [getter, setter]

> }

Given that it's always there, what's the "^" for? It doesn't serve any syntactic purpose I can see and it's an extra character to type and to read.

>1) Guarding a return value
>The guard is known as a ValueGuard. A ValueGuard is sent the message
>"coerce(specimen)" and it either return a coercing of the specimen it finds
>acceptable, or it throws an exception. Were "any" just a ValueGuard, its
>definition would

Since it's purpose is to control what rights get out, I suppose you could call it a RightGuard. It helps ensure that your security doesn't stink.

>2) Guarding a variable definition.
>The guard is known as a SlotGuard. A SlotGuard is sent the message
>"makeSlot(specimen)", and it is expected to return a Slot whose initial value
>is that specimen, or a coercion of that specimen.

And in keeping with my previous comment, this one would be a WriteGuard.

>...long discussion of guards and their implications...

Aside from my criticism of the syntax (above), I really like this mechanism as a hook for the beginnings of a run-time type system. This is one of those things, however, whose presentation we should be *very* careful about so as not to dump a giant bag of complexity on the neophyte E programmer (as well as not dumping a giant bag of complexity on the E system developers!).