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

Paul Prescod paul@prescod.net
Wed, 29 Dec 1999 11:49:30 -0500


skaller wrote:
> 
>         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

Agreed.

> 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.

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.

 Paul Prescod