[nem-bug] [Nemerle 0000662]: C#3.0 like lambda expression operator priority

feedback at nemerle.org feedback at nemerle.org
Thu May 4 19:54:03 CEST 2006


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=662> 
======================================================================
Reported By:                akiramei
Assigned To:                nazgul
======================================================================
Project:                    Nemerle
Issue ID:                   662
Category:                   Compiler
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             05-04-2006 17:38 CEST
Last Modified:              05-04-2006 19:54 CEST
======================================================================
Summary:                    C#3.0 like lambda expression operator priority
Description: 
-- sample.n
using System;
using System.Collections.Generic;

module Extensions {
    public All [T] (this objs : IEnumerable[T], fn : T -> bool) : bool {
        return : {
            foreach (o in objs)
                when (!fn (o))
                    return (false);
            return (true);
        }
    }
}

// def ls = $ [0, 2 .. 10]; 
def ls = $ [0, 2 .. 10] : IEnumerable [int];

#if false
when (ls.All (x => x % 2 == 0)) // compile error : in argument
http://nemerle.org/bugs/view.php?id=1 (fn) of
ls.All, needed a int -> bool, got b ool: bool is not a subtype of int ->
bool [simple require]
#else
when (ls.All (x => (x % 2 == 0)))
#endif
    Console.WriteLine ("All : even");
--
I'd like to do this.
ls.All (x => x % 2 == 0)

but now, 
ls.All (x => (x % 2 == 0))

======================================================================

----------------------------------------------------------------------
 nazgul - 05-04-06 19:54 
----------------------------------------------------------------------
Fixed on trunk (r6222).

Issue History
Date Modified  Username       Field                    Change              
======================================================================
05-04-06 17:38 akiramei       New Issue                                    
05-04-06 19:54 nazgul         Status                   new => resolved     
05-04-06 19:54 nazgul         Resolution               open => fixed       
05-04-06 19:54 nazgul         Assigned To               => nazgul          
05-04-06 19:54 nazgul         Note Added: 0001228                          
======================================================================




More information about the bugs mailing list