Newsgroups: comp.sys.transputer
From: mse@wolverine.utias.utoronto.ca (Manfred Sever)
Subject: Occam Question
Organization: University of Toronto Institute for Aerospace Studies
Date: 25 Oct 94 02:20:39 GMT
Message-ID: <1994Oct24.222038.23554@jarvis.cs.toronto.edu>

Hi y'all,

i have the following OCCAM code fragment:

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

What happens is that the array `samples' gets
filled by a `CHAN OF []INT' since it is an array
of INTs.

I need to send this data out on a `CHAN OF []BYTE',
hence the necessity of the RETYPES command.

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

In FORTRAN 77, I would have accomplished the above
using the EQUIVALENCE command.  In C, I would have
done this by declairing a pointer of type CHAR
and assigning it the value of the memory address
of the first element of the array `samples'.

My question is:

1.)  Will this actually work?
2.)  Is there a more elegant way of doing this in OCCAM?

The array `samples' and its alias `data' are
not used in any other parts of my OCCAM programme.


Your feedback is greatly appreciated.

Thanks in advance,

Manfred.
-- 
===============================================================================
Manfred D. M. Sever               |
                                  |
Space Robotics Group,             | E-mail: sever@ecf.utoronto.ca

