Newsgroups: comp.sys.transputer
From: teig@autro1.UUCP (Oyvind Teig)
Subject: Occam FUNCTION etc. (was :- Revision of occam2 ref. manual)
Organization: Autronica A/S, Trondheim, Norway
Date: 16 Aug 94 07:24:33 GMT
Message-ID: <176@autro1.UUCP>

FUNCTIONS

I always thought that the beauty of occam FUNCTION was that it
was side-effect free, that I could use it in an expression without
bothering. So expression evaluation with FUNCTION included is safe.
(I accept that I have to bother not to divide by zero in there
or have a livelock, that is much easier to ensure).

But FUNCTION could have returned arrays..

I feel that it is no (practical) argument against occam that it can use
an unitialized variable, or divide by zero. I would not want my compiler
to init all variables to (say) 0 (why 0?). In this class occam must
have to share fate with C, which is ok.

(Another thing, I would like to have installed an alternative
CAUSEERROR() function. A CAUSEERROR (Text, reason) could have been
automatically routed up to host, then crash, so that I did not have to
run the debugger. (I use CAUSEERROR quite a lot, to catch myself, not
user input). This could have been done with a scheme like this:
When the Iserver sees that the error line has been activated, it still
tries to communicate to get the "Text, reason" message. This would be
a little way to the Exception Handler thinking, without having to include
such nasty things. Nowadays, with the Virutal Channels, the routing
of that error message would have been easy. Also, a compiler switch
would allow in-built crashes to report in the same way.)

0.Teig Autronica Trondheim Norway

