[Prev][Next][Index][Thread]

Re: Q: statements in module file?



On Tuesday, June 26, 2001, at 11:39  am, Roland Paterson-Jones wrote:

> Well I was actually somewhat worried from the perspective of a compiler
> writer.

Infix Dylan is, by all accounts, a nightmare to implement.

> While it would be easier (possibly) to execute each statement in
> place in an interpreted environment, it makes it far more difficult 
> for a
> compiler, since you essentially have to generate a 'current snapshot'
> environment for each section of top-level code.

Not really, you just flatten out the files into one big file,expand all 
the macros, then lazily compile the resultant list of declarations. 
(This is a conceptual view rather than a practical one).

> It also means that things like 'define class' have a different 
> semantics to
> (top-level) 'make( <class> ... )' since the latter will be lumped with 
> the
> module initializer code and executed later.

They end up as the same thing: define class decomposes to a top-level 
binding bound to a call to make(<class>), and is compiled/called at that 
point in the code.

> Actually, I'm not entirely sure if you could tell the difference in 
> order.

Exactly. :-)

- Rob.