От: | _nn_ | www.nemerleweb.com | |
Дата: | 17.10.09 13:46 | ||
Оценка: |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
static class Program
{
static void Main(string[] args)
{
var a = new List<int> { 10,2,33,4,5,40 };
var b = F(a);
foreach(var x in b)
Console.WriteLine(x);
}
static IEnumerable<int> F(IEnumerable<int> e)
{
return from x in e where x > 10 orderby x descending select x;
}
}
}
using System;
using System.Collections.Generic;
using System.Console;
using Nemerle.Utility;
using Nemerle.Data.Linq;
module Program
{
Main() : void
{
def a : List[int] = List([10,2,33,4,5,40]);
def b = F(a);
foreach(x in b)
Console.WriteLine(x);
}
F(e : IEnumerable[int]) : IEnumerable[int]
{
<#linq from x in e where x > 10 orderby x descending select x #>
}
}
C:\Users\K\Documents\Nemerle Studio\ConsoleApplication1\Main.n(17,29):Error: expected System.Collections.Generic.IEnumerable[int], got string in function return value: the types char and int are not compatible [simple unify]