[m-dev.] taking the address of field access functions

Ralph Becket rafe at cs.mu.OZ.AU
Fri Jun 30 12:32:20 AEST 2006


Ian MacLarty, Friday, 30 June 2006:
> Is there some fundamental reason we don't allow passing field access
> functions as higher order terms?  I saw some comments in the compiler
> saying it wasn't allowed, but non saying *why* it wasn't allowd.  I have
> some cases where this would be useful.  Of course I can just define a
> wrapper function that calls the field access function, but I don't see
> why I shouldn't be able to pass the field access function itself.

The problem is twofold:
(1) we don't currently support "taking the address" of multi-moded
functions;
(2) field access functions are constructed on demand in order to get the
modes right regardless of context.

I would support a change to the language allowing the user to optionally
specify the usable modes for field access functions without having to
provide implementations.

I suspect that if we had parametric modes working properly (and found
some way of handling uniqueness) then this problem could be made to go
away.

-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list