Re: Proposal: Syntax extension

From: Sebastian Fischer <sebf_at_informatik.uni-kiel.de>
Date: Sat, 29 Jan 2011 11:20:48 +0900

On Sat, Jan 29, 2011 at 1:00 AM, Wolfgang Lux <wlux_at_uni-muenster.de> wrote:

> Sebastian Fischer wrote:
>
>> I support overlapping case expressions with non-deterministic semantics
>> but would like to avoid the name 'fcase' in favor of 'cases'.
>
> I disagree.


I'm not sure I understand. I meant that 'cases' should behave exactly as
your proposed 'fcase', only have a different name. That is

    cases a of { p -> b; q -> c }

would be equivalent to

    let f p = b; f q = c in f a

The different name is meant to highlight the equivalence of 'cases'
expressions and declarations of functions (or operations).


> Recall that the f in fcase stands for flexible pattern matching, but not
> for flat patterns.


I think it suffices (and is preferable) to just say that fcase/cases
expressions mean the same as multiple rules.

It would look strange to me if we would burden the user with disentangling


This would not be necessary, because 'cases' should be flexible exactly as
your fcase.


> Your proposal for making every identifier that starts with an underscore a
> logical variable is problematic, however. The problem is that the scope of
> such variables is no longer clear with local definitions.
>

Yes, I agree that the scoping is important and I think it should be easily
predictable. This is why I proposed to use the scope of the top-level rule
via a where clause. Users who want a different scope would need to declare
the variable.

Sebastian



_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Sa Jan 29 2011 - 19:29:43 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:11 CEST