[nem-bug] [Nemerle 0000662]: C#3.0 like lambda expression operator
priority
feedback at nemerle.org
feedback at nemerle.org
Thu May 4 17:38:59 CEST 2006
The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=662>
======================================================================
Reported By: akiramei
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 662
Category: Compiler
Reproducibility: always
Severity: trivial
Priority: normal
Status: new
======================================================================
Date Submitted: 05-04-2006 17:38 CEST
Last Modified: 05-04-2006 17:38 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))
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
05-04-06 17:38 akiramei New Issue
======================================================================
More information about the bugs
mailing list