[Types-sig] PyDL RFC 0.02

skaller skaller@maxtal.com.au
Wed, 29 Dec 1999 03:57:15 +1100


Greg Stein wrote:
 
> It doesn't seem to be simple concatenation. How are conflicts handled? How
> are merges done? e.g. a method is not declared in the interface file, but
> it does have a declaration in the source.

	Yes. Can we please assume the following position:

	1) declarations can be embedded.
	2) declarations can also be given in a separate file
	3) Processing module X commences by loading the 
	   separate interface file
	4) Next, the .py file is scanned for declarations
	5) The results of (3) and (4) are merged somehow
	6) The .py files is scanned again by the code generator

We must make some decisions here. 

Question: what happens if a typedecl kind of name is 
declared more than once?

Partial Answer 1: This must be permitted, because this
is _exactly_ what will happen if the .pi file is generated
from the .py file by scanning for declarations.

It is not necessary to permit such declarations twice
in the _same_ file though.

One possible solution: require the declarations be
identical, token for token: this is what C++ requires.

Another solution: the declarations
must be semanically equivalent. What this means is that
the processor is free to chose either declaration
as 'the' definition.

Another solution: use the second declaration.

Another solution: require _both_ apply
(the product: combine constraints).

Another: require _either_ apply:
(the sum: take the 'union')

I could do some analysis on these alternatives,
but first, we need to agree there is an issue here.

I note there is plenty of existing practice -- 
with different resolutions :-)

-- 
John Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
voice: 61-2-9660-0850