[mercury-users] Higher order (was The Logic of Mercury)
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Sep 17 01:06:15 AEST 1999
On 10-Sep-1999, Thomas Conway <conway at cs.mu.OZ.AU> wrote:
> On Fri, Sep 10, 1999 at 09:18:22AM EST, Richard A. O'Keefe wrote:
> > The important thing in this thread is that stashing a token in a data
> > structure instead of stashing a closure doesn't help. In fact, it can
> > make things worse.
>
> OTOH, Lee's proposal is useful in Mercury because the token can quite
> happily be given an inst `ground', where as a closure, to be called
> must have a `pred(ArgModes) is Determinism' inst which is a subtype
> of `ground'. The problem with it is more to do with extensibility and
> modules. Consider again the example I showed earlier where the closures
> were stored in a "function table". If I have an access predicate for
> registering a new function, then any client can add a new function. If
> I have to define a type for the `token', then modularity becomes a problem
> since Mercury doesn't allow distributed types or predicates.
One way to overcome the extensibility problem is to use `univ' for your
token type.
However, the current implementation doesn't optimize code using `univ'
as well as it could, so if efficiency is the aim then `univ' may not
help.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list