[Mozart Oz Users] order of ports?

Denys Duchier Denys.Duchier at ps.uni-sb.de
Mon Mar 12 11:42:47 CET 2001


frehberg at cs.tu-berlin.de (Frank Rehberger) writes:

> how can I  get a globaly complete order on ports easily?

Why do you want to compare ports?

> As much as I read, only Integers, Floats and Atoms can be compared
> without raising exceptions?

There are well-defined natural orders on these values; there is none
on ports.  The problem with imposing an arbitrary order on random
data-structures is that this order must persist through garbage
collection and variable binding/constraining.  For example, a
well-known thorn in the side of Prolog implementors is the possibility
of comparing variables for precedence order, which has the
aforementioned problems, and additionally is unsound since the order
does not persist through variable binding.

> If ports cant be compared directly, it might be usefull to create
> globaly unique numbers.  How do I get gl.uniq.numbers in Mozart
> 1.1.0?

For Mozart 1.1.0 there are only 2 possibilities:

* write a native functor: see e.g. the native counter example of the
  "Application Programming" tutorial

* fake it using {Property.get 'time.total'}: to make sure you get a
  new time, you have to get it once then keep getting it in a loop
  until it changes: the new time value has never been seen before and
  you can use it a a unique number.

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