Re: Proposal: Syntax extension

From: Michael Hanus <mh_at_informatik.uni-kiel.de>
Date: Thu, 06 Jan 2011 09:48:53 +0100

Sergio Antoy wrote:
> > 2. Non-linear patterns in function declarations: allow multiple occurences
> ...
> Yes. One could also have x==z. Why is x=:=z preferred?
> In true FLP there should be (almost) no residuation. But
> since there is residuation in Curry, all options should be
> considered and the chosen one justified.

Good point. Since function declarations are always flexible
(in contrast to earler versions), I think that matchings
with non-linear left-hand sides should not suspend. If one translates

  f x x = x

into

  f x z | x=:=z = x

then a call like (f x1 x2) will unify x1 and x2 without suspending
the computation.

The use of x==z would be reasonable for non-linear patterns
in case expressions, as Wolfgang discussed.

Best regards,

Michael
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Do Jan 06 2011 - 09:54:57 CET

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