[Oz] equality of unbound variables
Denys Duchier
Denys.Duchier at ps.uni-sb.de
Thu Jan 6 13:29:34 CET 2000
Hi Cesare,
I am now back from vacation. Here is my belated answer to your last
message.
tinelli at cs.uiowa.edu (Cesare Tinelli) writes:
> My only concern is that, as I understand it, the approach you highlight
> above still requires for a term to be known in advance (at compile time,
> that is) to be encapsulated. I don't quite understand how to use the
> encapsulation technique with terms that are only known at run time, for
> instance because they are passed as input.
> Well, if the term is passed as a string, it is fairly straightforward to
> wrap it into a function definition (with the proper local variable
> definitions), feed it to Compiler.virtualStringToValue say, and get its
> encapsulated version.
For input, as you suggest, this is not an issue. Personally, I often
use Gump to define an application specific language/notation when that
is more convenient. In your case, I don't know if that would be a
worthwhile gain: input is supposed to be a predicate rather than a
bare term. Instead of:
forall X . f(X X)
the user supplies
fun {$} X in f(X X) end
i.e. this is the same as:
proc {$ T}
T={MakeTuple f 2}
T.1 = T.2
end
a special purpose notation may allow an implicit quantification
(convenient), but then does not support a notion of scope
(inconvenient).
> What I don't see is how to encapsulate an Oz record at run time.
You would never have a non-encapsulated term, except within an
encapsulated computation which results in an encapsulated term. In
fact, you suggest this yourself:
> But again, maybe I'm thinking in the wrong terms. Maybe there
> is a way to design any Oz application from the outset so that "run-time
> encapsulation" will never be needed.
If you have a practical example where you have difficulty seeing how
to preserve encapsulation, please let me know and I'll be happy to
suggest how to modify your design.
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