@c "cast2hac/definitions.texi"
@c $Id: definitions.texi,v 1.1 2007/08/16 23:48:11 fang Exp $

@node Definitions
@chapter Definitions
@cindex definitions

Definitions use the keywords @kwdefproc{}, @kwdefchan{}, and @kwdefdata{}.  
The old @CAST{} keyword @kwdefine{} can simply be replaced with @kwdefproc{}.  

TODO: write more on newer port restrictions...

@menu
* Ports:: process interfaces
@end menu

@c ----------------------------------------------------------------------------
@node Ports
@section Ports

In @CAST{}, port declarations were allowed to be sparse, 
whereas in @HAC{}, only dense declarations are allowed.

The following @CAST{} definitions were legal:

@verbatim
define foo()(node x[1..3]) { }
define bar()(node x[0..2]) { }
@end verbatim

However, in @HAC{}, there is no equivalent to declaring port instances
that start with non-zero indices.  
Note, that in @CAST{}, the first set of parentheses in each definition
are reserved for template parameterization.  
Thus, the above definition of @t{foo} cannot be expressed in @HAC{}, 
whereas the definition of @t{bar} could be rewritten:

@verbatim
defproc bar(bool x[3]) { }
@end verbatim

@c See Section~\ref{sec:arrays} 
For more on dense and sparse arrays 
and their declarations,
@xref{Arrays}.
@c Section~\ref{sec:templates} 
@ref{Templates}
describes how to generalize definitions
using template parameters.  


