Re: Proposal: Lazy matching for local patterns

From: Wolfgang Lux <lux_at_wi.uni-muenster.de>
Date: Thu, 25 Oct 2001 11:30:49 +0200

German Vidal wrote

> When the evaluation of these variables is required, then I would
> expect that both functions behave the same way. And this will not
> happen if accessor functions are always rigid independently of the
> evaluation annotation of the function where the local declaration
> appears. For instance, if accessor functions are always rigid,
> then "foo undefined" suspends with the definition
>
> foo eval flex
> foo n = let (x,y) in [x,y]
>
> while it does not suspend with the definition
>
> foo eval flex
> foo (x,y) = [x,y]
>
> Thus I would prefer that accessor functions have the same
> evaluation annotation as the function where the local declaration
> appear. Of course, I have no idea whether it is easy or difficult
> to incorporate into existing compilers. Is there any special
> trouble here?

For our compiler this somewhat breaks the modularity of the compiler.
If the accessor functions should have the same evaluation mode as the
function which contains the declaration, the lifting algorithm has to
*understand* how the evaluation mode of a function is determined. This
may involve looking for an evaluation annotation for the function, then
testing for a global pragma declaration and eventually also checking
the function's result type. This is certainly possible but I'd prefer
to leave these details constrained to the pattern matching compiler.

Regards
Wolfgang



--
Wolfgang Lux				  Phone: +49-251-83-38263
Institut fuer Wirtschaftinformatik	    FAX: +49-251-83-38259
Universitaet Muenster		      Email: wlux_at_uni-muenster.de
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Do Okt 25 2001 - 13:52:19 CEST

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:05 CET