[svn] r6298: nemerle/trunk: macros/operators.n
ncc/testsuite/positive/basic-macros.n
nazgul
svnadmin at nemerle.org
Tue May 16 21:37:10 CEST 2006
Log:
Allow wildcard as parameter of => lambda expression
Author: nazgul
Date: Tue May 16 21:37:07 2006
New Revision: 6298
Modified:
nemerle/trunk/macros/operators.n
nemerle/trunk/ncc/testsuite/positive/basic-macros.n
Modified: nemerle/trunk/macros/operators.n
==============================================================================
--- nemerle/trunk/macros/operators.n (original)
+++ nemerle/trunk/macros/operators.n Tue May 16 21:37:07 2006
@@ -187,6 +187,7 @@
macro @=> (parms, body) {
def convert_to_parm (x) {
+ | <[ _ ]> => <[ parameter: _ ]>
| <[ $(nm : name) ]> => <[ parameter: $(nm : name) ]>
| <[ $(nm : name) : $ty ]> => <[ parameter: $(nm : name) : $ty ]>
| _ => Message.FatalError ($"unsupported syntax for parameter of 'parms => body' lambda expression: $x");
Modified: nemerle/trunk/ncc/testsuite/positive/basic-macros.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/basic-macros.n (original)
+++ nemerle/trunk/ncc/testsuite/positive/basic-macros.n Tue May 16 21:37:07 2006
@@ -321,6 +321,8 @@
def add : int -> int -> int = x => y => x + y;
def add_5 = add (5);
System.Console.WriteLine (add_5 (2));
+ def ign = _ => 1;
+ assert (ign ("ss") == 1);
}
More information about the svn
mailing list