Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1B4702009DC for ; Tue, 2 May 2017 21:18:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 19DC0160BAB; Tue, 2 May 2017 19:18:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6018E160B9D for ; Tue, 2 May 2017 21:18:22 +0200 (CEST) Received: (qmail 77597 invoked by uid 500); 2 May 2017 19:18:21 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 77588 invoked by uid 99); 2 May 2017 19:18:21 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2017 19:18:21 +0000 Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 299421A0280 for ; Tue, 2 May 2017 19:18:21 +0000 (UTC) Received: by mail-io0-f172.google.com with SMTP id o22so40746447iod.0 for ; Tue, 02 May 2017 12:18:21 -0700 (PDT) X-Gm-Message-State: AN3rC/4XtQMhaABCo6hNGjrUuddjG6+V+5R3441gqkH6Irz3yjbOim96 elsZMDkRWvrGbjGYl1oK9vdIoy/L+09q X-Received: by 10.157.20.250 with SMTP id r55mr3154008otr.28.1493752700495; Tue, 02 May 2017 12:18:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.41.146 with HTTP; Tue, 2 May 2017 12:17:50 -0700 (PDT) In-Reply-To: <1493750772518-12354.post@n6.nabble.com> References: <1493750772518-12354.post@n6.nabble.com> From: Pavel Tupitsyn Date: Tue, 2 May 2017 22:17:50 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Ignite .NET vs Java To: user@ignite.apache.org Content-Type: multipart/alternative; boundary=001a1141d73a187ee1054e8f677d archived-at: Tue, 02 May 2017 19:18:23 -0000 --001a1141d73a187ee1054e8f677d Content-Type: text/plain; charset=UTF-8 You have to implement IComputeFunc. Ignite.NET does not have overloads for anonymous functions & lambdas. We have plans to add them in future versions. On Tue, May 2, 2017 at 9:46 PM, Humphrey wrote: > I'm trying to do the following in .NET with C# using lambda expression and > I > can't figure out how to do the same thing I can do with Java. > ---- > In Java I can do the following: > > List listOfWords = Arrays.asList("How many characters are > there?".split(" ")); > Collection res = ignite.compute().apply((String word) -> > word.length(), listOfWords); > ---- > Now I'm trying to do the same in .NET with C#: > > ICollection words = "Count characters using > closure".Split().ToList(); > var res = ignite.GetCompute().Apply((string x) => x.Length, > words); > ---- > It looks like it is trying to invoke the following method: > TRes Apply(IComputeFunc clo, TArg arg); > > Instead I want it to invoke the following method: > ICollection Apply(IComputeFunc clo, > IEnumerable args); > > Both apply overloaded method have the same amount of paramters, so how do I > specify it to use the correct apply method? I don't want to create an > implementation of the IComputeFunction but want to use lambda like I can do > in Java. > > I have tried different combination of the <> after Apply, for example > Apply or without the <>. > The complete code (using implementation of the IComputeFunction) is in the > .NET examples of ignite. I'm trying to find out the equivalent lambda way > in > C#. > > Humphrey > > > > -- > View this message in context: http://apache-ignite-users. > 70518.x6.nabble.com/Ignite-NET-vs-Java-tp12354.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. > --001a1141d73a187ee1054e8f677d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You have to implement=C2=A0IComputeFunc.
Ignite.NET do= es not have overloads for anonymous functions & lambdas.
We h= ave plans to add them in future versions.

On Tue, May 2, 2017 at 9:46 PM, Humphre= y <hmmlopez@gmail.com> wrote:
I'm trying to do the following in .NET with C# using lambda expres= sion and I
can't figure out how to do the same thing I can do with Java.
----
In Java I can do the following:

List<String> listOfWords =3D Arrays.asList("How many characters = are
there?".split(" "));
Collection<Integer> res =3D ignite.compute().apply((String word) ->= ;
word.length(), listOfWords);
----
Now I'm trying to do the same in .NET with C#:

ICollection<string> words =3D "Count characters using
closure".Split().ToList();
var res =3D ignite.GetCompute().Apply<string, int>((string x) = =3D> x.Length,
words);
----
It looks like it is trying to invoke the following method:
TRes Apply<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg);=

Instead I want it to invoke the following method:
ICollection<TRes> Apply<TArg, TRes>(IComputeFunc<TArg, TRes&= gt; clo,
IEnumerable<TArg> args);

Both apply overloaded method have the same amount of paramters, so how do I=
specify it to use the correct apply method? I don't want to create an implementation of the IComputeFunction but want to use lambda like I can do=
in Java.

I have tried different combination of the <> after Apply, for example=
Apply<string, int> or without the <>.
The complete code (using implementation of the IComputeFunction) is in the<= br> .NET examples of ignite. I'm trying to find out the equivalent lambda w= ay in
C#.

Humphrey



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-NET= -vs-Java-tp12354.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

--001a1141d73a187ee1054e8f677d--