Web Reservoir
2008-Mar-13 07:30 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
Hello, I know that its too early to ask or it. But can someone provide few examples, how Linq with IronRuby will look alike. Since i am reading few books on LINQ in C#, i want to gradually try to understand it with IronRuby point of view. I do not want examples to play around. I want examples to understand LINQ with IronRuby. I hope someone might help me here. -- Posted via http://www.ruby-forum.com/.
Ivan Porto Carrero
2008-Mar-13 07:52 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
I think this should answer your question http://rubyforge.org/pipermail/ironruby-core/2008-January/000706.html On Thu, Mar 13, 2008 at 8:30 PM, Web Reservoir <lists at ruby-forum.com> wrote:> Hello, > > I know that its too early to ask or it. > > But can someone provide few examples, how Linq with IronRuby will look > alike. > > Since i am reading few books on LINQ in C#, i want to gradually try to > understand it with IronRuby point of view. > > I do not want examples to play around. I want examples to understand > LINQ with IronRuby. > > I hope someone might help me here. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080313/026f2f0c/attachment.html
Web Reservoir
2008-Mar-13 12:40 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
Ivan Porto Carrero wrote:> I think this should answer your question > http://rubyforge.org/pipermail/ironruby-core/2008-January/000706.html--------------------------------- Ho Ivan, Thanks for pointing me a link. But the link is obsolete now. ------------------------------------------------------------ Translating this example: http://msdn2.microsoft.com/en-us/library/bb397947.aspx, it will look something like this: require ''System.Core'' numbers = [5, 10, 8, 3, 6, 12] numbers.where { |num| num % 2 == 0 }.order_by { |n| n }.each { |i| write("#{i} ") } - John -------------------------------------------------------------- I could see the example in Ruby, but the actual msdn2 link is now obsolete and the code is removed. So i am unable to make any comparison. -- Posted via http://www.ruby-forum.com/.
John Lam (DLR)
2008-Mar-13 12:44 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
Remove the comma from the URI.> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Web Reservoir > Sent: Thursday, March 13, 2008 5:41 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Few Small Examples in Linq with IronRuby > > Ivan Porto Carrero wrote: > > I think this should answer your question > > http://rubyforge.org/pipermail/ironruby-core/2008-January/000706.html > --------------------------------- > Ho Ivan, > > Thanks for pointing me a link. But the link is obsolete now. > > ------------------------------------------------------------ > Translating this example: > http://msdn2.microsoft.com/en-us/library/bb397947.aspx, it will look > something like this: > > require ''System.Core'' > numbers = [5, 10, 8, 3, 6, 12] > numbers.where { |num| num % 2 == 0 }.order_by { |n| n }.each { |i| > write("#{i} ") } > > - John > -------------------------------------------------------------- > > I could see the example in Ruby, but the actual msdn2 link is now > obsolete and the code is removed. > > So i am unable to make any comparison. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Web Reservoir
2008-Mar-13 13:47 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
John Lam (DLR) wrote:> Remove the comma from the URI.------------------------------------------ Thanks John. I did not notice that little comma. I just clicked the link. Here''s the C# Code. ---------------------- class QueryVMethodSyntax { static void Main() { int[] numbers = { 5, 10, 8, 3, 6, 12}; //Query syntax: IEnumerable<int> numQuery1 from num in numbers where num % 2 == 0 orderby num select num; //Method syntax: IEnumerable<int> numQuery2 = numbers.Where(num => num % 2 == 0).OrderBy(n => n); foreach (int i in numQuery1) { Console.Write(i + " "); } Console.WriteLine(System.Environment.NewLine); foreach (int i in numQuery2) { Console.Write(i + " "); } // Keep the console open in debug mode. Console.WriteLine(System.Environment.NewLine); Console.WriteLine("Press any key to exit"); Console.ReadKey(); } } /* Output: 6 8 10 12 6 8 10 12 */ With IronRuby, LINQ would be a fun. Hope to see such more examples soon. Thanks -- Posted via http://www.ruby-forum.com/.
Web Reservoir
2008-Mar-14 06:47 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
Sorry for my more questions on LINQ. I just read in LinQ in Action...it goes like this... In chapter 2, we?ll show you the details of how the programming languages have been extended to support LINQ. In chapter 3, you?ll learn how to write LINQ queries. This is where you?ll learn about query operators, query expressions, and expression trees. But you still have a few things to discover before getting there. what i understand is... C# and Vb.Net have been extended to meet the LINQ requirement. So now we have C# 3.0 and Vb2008 right. My question is ... what about Ruby 1.8 or 1.9...? are they already capable with their inbuilt features to support LINQ or IronRuby shall incorporate those extra additions to meet the LINQ requirement....? How far in IronRby from LINQ now...? Thanks -- Posted via http://www.ruby-forum.com/.
Rahil Kantharia
2008-Mar-15 06:43 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
Web Reservoir wrote:> But can someone provide few examples, how Linq with IronRuby will look > alike.------------------------------------------- I am the second interested. LINQ 2 SQL is very important. I think few experts should start some tutorials about this Looking at the codes in C# and Vb.Net does not make any sense, as we are never going that way. IronRuby + LINQ is the way many like me would go. -- Posted via http://www.ruby-forum.com/.
Softmind Technology
2008-Mar-27 06:18 UTC
[Ironruby-core] Few Small Examples in Linq with IronRuby
Rahil Kantharia wrote:> Web Reservoir wrote:> LINQ 2 SQL is very important. I think few experts should start some > tutorials about this >I think, its time for some experts to come ahead a start blogging about Linq to sql with Iron Ruby to start with. + 1 on the suggestion by Mr.Rahil SoftMind -- Posted via http://www.ruby-forum.com/.