[Oz] Oz vs. Squeak
Peter Van Roy
pvr at info.ucl.ac.be
Thu Feb 1 11:27:14 CET 2001
> Peter Van Roy <pvr at info.ucl.ac.be> writes:
> >
> > 1. Truly first-class software components, called 'functors'. They
> > have lots of advantages. For example, they are linked dynamically
> > by default, giving fast system startup times.
>
> Have you looked at the PLT Units module system, by the way? Oz
> doesn't seem to provide parametric modules as PLT Units does. Maybe
> I'm wrong on this though; Oz's ability to use different module
> managers adds some subtleties to this issue.
>
> --
> Mark Seaborn
Functors can have external references and can be created at run-time,
just like all other data types. This allows to parameterize them.
Here's a pretty useless example, but it shows the point:
fun {NewAdder N}
functor
export inc:Inc
define
fun {Inc X} X+N end
end
end
% Create a software component parameterized by '5':
F={NewAdder 5}
The documentation speaks of 'computed functors'; these are just
syntactic sugar for the above technique.
Exactly the same technique can be used to parameterize classes.
Module managers are a different issue; they essentially define
environments inside of which software components 'share' common imported
components. Between separate environments, if the same component
is imported twice, it will be installed twice. There is just one
environment by default, so importing the same component twice will
only install it once by default. Module managers are not needed for
parameterizing components.
I don't know of PLT Units; can you summarize its main characteristics
(or at least the relevant ones)?
Peter Van Roy
-
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