Duplicate declarations Re: [Types-sig] PyDL RFC 0.02

skaller skaller@maxtal.com.au
Thu, 30 Dec 1999 12:48:20 +1100

Paul Prescod wrote:
> In my model:
> Human creates .pi
> Human creates .py
> Type extractor scans .py and generates .gpi
> Type checker reads .pi and .gpi
> So we have no problem with the same declaration being read twice. Thus I
> would say that for version 1 we should ban duplicate declarations.

But you have not addressed the possibility that the .pi and .gpi
contain a declaration for the same name: more precisely,
at this point the above description does not describe exactly
how the set of declarations (interfaces) is constructed. Presumably,
the following axiom holds:

	name in names if name in (gpi xor pi)

where we're talking about sets. What happens if:

	name in (gpi and pi)

Here, there are TWO declarations of the same name.
I don't think you can ban this, because it is not
only likely to be a common case, it is likely
to be almost EVERY case -- since many people
will use a 'genpi' tool to extract embedded declarations
into a separate interface file -- but won't remove
the embedded declarations.

A rule is required, but the one you mention (don't allow it),
will not work in practice (IMHO).

Or perhaps I misunderstand completely, and what you are
saying is that the type checker's work is exactly to
check that the gpi names do not conflict with the .pi

[Hmmm: the more I think about it, the more this seems to
be your intent ..??]

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