A New Revealation: Semi-Permeable Membranes
Mark S. Miller
Wed, 27 Oct 1999 15:42:11 -0700
At 12:50 PM 10/27/99 , Marc Stiegler wrote:
>Random inspection of pages of Edesk (not the whole thing) suggests that
>indeed almost half my methods return no value. ...
[+] Thy wish is granted. I just needed this empirical result first.
The whole SlotGuard / ValueGuard / "return" type mechanism, as discussed, with return types defaulting to ": void", and with the proposed initial guards all available by these names in the universal name space, is all implemented and check in -- though not yet released.
>Huffy, huffy :-) I'm probably using the terms "function" and "object"
>slightly differently, and surely wrongly :-) Think of an object as a thing
>created with the objectMaker pattern: in this situation, the object has a
>place to store state that is local to the object itself (or at least local
>to the objectMaker). A pure function has no local place to store state, it
>depends on its environment for state. So function state tends to be more
>global than object state, which leads me to be more uncomfortable about
>function state than object state. This in turn would in theory lead me to
>use state less often with functions.
>Feeling that I have just won the theory side of this argument decisively
>(hey, we all have our illusions),
[-] Perhaps you have, but it went by too fast. I didn't understand the above.
You say a function "depends on its environment for state" and contrast this to the objectMaker pattern. However, all E objects depend only on their environment for their state, which is why the objectMaker pattern works. E provides no alternative.
> > Write ": any" when you want to reveal a value and ": void" when you
> > don't. We'll explain later.
> Write ": any" when you want to return a value and ": void" when you
> We'll explain later how to optionally use this for type checking.
>Note the use of the term "return", which is more familiar, if you can bring
>yourself to tolerate it; in this context it really doesn't seem harmful to
>me. And we mention the opportunity for optional type checking, which will
>please the Pascal people (since it's possible) and won't upset the Perl
>people (since it's optional).
[+] Agreed on all points.