Required Declaration of C Function Parameters

Mike Kupfer kupfer at ucbvax.UUCP
Sun Aug 5 09:57:14 AEST 1984

> I think the key is that the type of the function `func' is just its
> value type and the fact that it is a function, i.e. `t_func ()',
> and the types of the parameters are not part of its formal type
> although it is required that the parameter types be given in the
> function declaration.  This is an important distinction that solves
> the problem of recursive types.

This may be necessary with C's peculiar type declaration syntax,
but it's not true in general.  (The point being that maybe some
ingenious soul can come up with an acceptable solution for C.)
In Xerox's Cedar programming language, both the return type(s)
and the argument types are part of the procedure's formal
type.  As for recursive definitions, Cedar likes the following
declaration just fine:

	MyProcType: TYPE = PROC [MyProcType, Rope.ROPE];

which recursively defines the type of the first argument (and defines
a sort of string as the type of the 2nd argument).  You could use this
declaration in something like:

	MyProc: MyProcType = {...};
Mike Kupfer at Xerox.ARPA
kupfer at Berkeley
"Even a sonic screwdriver can't get me out of this one!"

More information about the Comp.lang.c mailing list