[Mozart Oz Users] newbie question (declarations)
Denys Duchier
Denys.Duchier at ps.uni-sb.de
Wed Mar 7 12:39:39 CET 2001
volpadri at tin.it writes:
> declare
should be reserved for interactive use.
> define
introduces the section of a functor which is executed at link time
(i.e. when it is linked in by the module manager when the application
is executed)
> functor
much like `proc' starts a procedure, `functor' starts a functor.
> in
this is for convenience. E.g. you can write `DECLARATIONS in
STATEMENTS' instead of `local DECLARATIONS in STATEMENTS'.
> local
introduces a new lexical local scope where you can introduce new
identifiers.
> prepare
introduces the section of a functor which is executed at compile
time. The `define' or `export' sections can reference identifiers in
the `prepare' section. If the functor is to be saved to a file
(i.e. made persistent), then these identifiers should be bound to
stateless values (since unbound variables and stateful values cannot
be made persistent).
You missed out `import' which introduces the section specifying
imports, `export' which specifies exports, and `require' which is to
`prepare' what `import' is to `define'.
Cheers,
--
Dr. Denys Duchier Denys.Duchier at ps.uni-sb.de
Forschungsbereich Programmiersysteme (Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45 http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50 Phone: +49 681 302 5618
66041 Saarbruecken, Germany Fax: +49 681 302 5615
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-users
mailing list