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

Re: Q: statements in module file?



On Tue, 26 Jun 2001, Rob Myers wrote:

> On Monday, June 25, 2001, at 05:30  pm, Roland Paterson-Jones wrote:
>
> > It seems to me that you can have arbitrary statements at the top-level
> > in dylan (i.e. in between the method and class definitions).
>
> Yes, you can. main() is called in this way, and various registration
> methods and initializers in libraries work in this way.
>
> > What is the exact semantics of this?
>
> Well, just about any Dylan code can go in IIRC, but you can't do lets
> unless you put them in a block. ...
> As for execution order I'd imagine it's parse order.

RTDRM ;-)  See Chapter 2 "Syntax" / "Top-Level Definitions"
  <http://www.gwydiondylan.org/drm/drm_22.htm#HEADING22-0>
and Appendix A "BNF" / "Phrase Grammar"
  <http://www.gwydiondylan.org/drm/drm_118.htm#HEADING118-0>
for example.

Also, with regard to the difference between "define class <foo> ..." and
"define constant <foo> :: <class> = make(<class>, ...)", one minor
difference is that a call to "make(<class>)" can't create a sealed class.

<doffs language lawyer's wig ;->
Hugh

-- 
Version 3.1 GCS/IT d- s+:+>+: a- C++$ UL P+ L+(++) E W++$ N++ o K++ w(++) O?
M V? PS(+) PE Y+ PGP->++ t(+) 5+(++) X(+) R tv b++ DI+ D+ G e++ h- r>++ y+
(Removed reversed spam from my email address to reply)