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

Ian MacLarty maclarty at cs.mu.OZ.AU
Fri Jun 30 13:23:25 AEST 2006


On Fri, Jun 30, 2006 at 12:32:20PM +1000, Ralph Becket wrote:
> 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.
> 

Couldn't we do the same thing when constructing a higher order term from
a field access function?  Surely we'll know the required mode of the
higher order term being constructed from context, so we can generate
the required access function on demand?  Or is it more complicated than
that?

Ian.
--------------------------------------------------------------------------
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