Newsgroups: comp.sys.transputer
From: jan@neuroinformatik.ruhr-uni-bochum.de (Jan Vorbrueggen)
Subject: Re: Occam Question
Organization: Institut fuer Neuroinformatik, Ruhr-Universitaet Bochum, Germany
Date: 25 Oct 94 13:48:52 GMT
Message-ID: <JAN.94Oct25144852@thalia.neuroinformatik.ruhr-uni-bochum.de>

In article <1994Oct24.222038.23554@jarvis.cs.toronto.edu>
mse@wolverine.utias.utoronto.ca (Manfred Sever) writes:

   i have the following OCCAM code fragment:

     [10]INT samples : 
     []BYTE data RETYPES [samples FROM 0 FOR 10] :

   The only way to get the above code to compile and run is to disable usage
   checking with the `A' compiler option.

Correct, that's as it should be.

   1.)  Will this actually work?  

Yes. 

   2.)  Is there a more elegant way of doing this in OCCAM?

Yes: the alias checker (which you are disabling with -a) wants, at any one
point in the programme, to see exactly one definition at the current scope for
any piece of store. So:

     [10]INT samples : 
     SEQ
       input ? samples
       SEQ
         []BYTE data RETYPES [samples FROM 0 FOR 10] :
         output ! data

will pass alias checking.

	Jan

