[Types-sig] RFC Comments
skaller
skaller@maxtal.com.au
Fri, 31 Dec 1999 04:46:42 +1100
Paul Prescod wrote:
>
> skaller wrote:
> >
> > ...
> > It _is_ possible to import only the interface
> > of a module, and this should be done when 'import X' is
> > seen. In pass two, a full two pass importation is triggered,
> > but the interface loading is skipped because the interface
> > is already loaded. However, the import still requires TWO
> > passes DURING PASS 2, because the implementation file
> > may also include inline declarations.
>
> Do you mean old fashioned Python function and class declarations or
> newfangled decls and typedecls?
Sorry, I mean't 'decls': i.e. interface declarations.
[which can also be embedded like 'def f(x as t)']
> > It follows FROM THE MODEL
> > that these declarations are effectively private.
>
> It was never my intent that decls and typedecls could be private.
OK. I think this is necessary for correct interface
design. But I concede that the default could sensibly be public;
and a 'private' keyword used?
> > Summmary: pass 1 processing only permits
> > pass 1 processing to occur recursively, whereas
> > pass 2 imports may invoke a full two phase translation.
>
> My plan was: do everything relating to types, in ALL modules and then do
> everything relating to code generation in all modules.
I see. I'm not sure that can work. The reason is,
interface loading is dynamic. Because module loading is dynamic.
[This can't be changed, it would break Interscript, for example]
My thought was the static processing would be done by
making the compiler two pass. And the compiler currently
runs when a module is first loaded -- at varying
times during code execution when 'import' statements
are executed.
> Still not sold on "include".
Leave it out, and see what happens.
Write some code: invent a mini-language (easy to parse in python),
and implement the model. I think something like:
import <name>
decl y
check y
where check y prints either 'y is defined' or 'y is not defined':
this code is to be executed at 'run time' to report on what names
are visible. Write the py -> pi tool.
[!]
> I am mildly uncomfortable with new expression syntax
Rightly so. I'm not insisting, just presenting
a feeling. I _do_ feel reasonably comfortable with 'as'.
[I write lots of code. I can't type well. I like code
compact. Means I can fit more information on a screen.
I like python string/sequence handling precisely because it
is a terse notation]
--
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