Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Miguel Madero
This might help, there's a library in the VS directory samples/CSharpSamples.zip/LinqSamples/DynamicQuery take a look, under the covers it's creating expressions LINQ Expressions. In C# you will just chain methods like: myCollection.Where("property=myValue").OrderBy("anotherProp desc"); I think

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
On Wed, Feb 3, 2010 at 10:59 AM, Ivan Porto Carrero < i...@whiterabbitconsulting.eu> wrote: > hashes? Just an example, though perhaps not the best. :) but may i ask why you're so hell-bent on linq? > I mostly want some way to use the Reactive Extensions for asynchronous programming and OpenXML

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
n Porto Carrero > *Sent:* Wednesday, February 03, 2010 8:49 AM > > *To:* ironruby-core@rubyforge.org > *Subject:* Re: [Ironruby-core] A nicer syntax for generic extension > methods > > > > For lightspeed I wrote an internal dsl that allows you to query similarly &

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ivan Porto Carrero
em::Collections::ICollection, System::Collections::Generic, Kernel] >>>>>> >>>>>> >>>>>> >>>>>> As you can see the List<> generic type definition is treated as a >>>>>> module that is mixed in each of its in

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Tomas Matousek
From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Wednesday, February 03, 2010 8:49 AM To: ironruby-core@rubyforge.org Subject: Re: [Ironruby-core] A nicer syntax for generic extension methods For lightspeed I wrote an

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
On Wed, Feb 3, 2010 at 10:49 AM, Ivan Porto Carrero < i...@whiterabbitconsulting.eu> wrote: > For lightspeed I wrote an internal dsl that allows you to query similarly > to the regular api but no special module for linq stuff. I skipped linq > altogether didn't need it there. > > so what I created

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ivan Porto Carrero
t >>>> Ruby class for List. If you index System.Collections.Generic.List by a >>>> fixnum instead of a class/module you’ll get the generic definition of arity >>>> 1. Let’s name it ListOfT: >>>> >>>> >>>> >>>> >>&g

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
gt;>>>> >>>>> >>>>> As you can see the List<> generic type definition is treated as a >>>>> module that is mixed in each of its instantiations. Although there are no >>>>> predefined methods on it you can open it and add some. First

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
t;>>>>> System::Collections::IEnumerable, Enumerable, System::Collections::IList, >>>>>> System::Collections::ICollection, System::Collections::Generic, Kernel] >>>>>> >>>>>> >>>>>> >>>>>>

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
t by a >>>> fixnum instead of a class/module you’ll get the generic definition of arity >>>> 1. Let’s name it ListOfT: >>>> >>>> >>>> >>>> >>> ListOfT = List[1] >>>> >>>> >

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-03 Thread Ryan Riley
e you’ll get the generic definition of arity >>> 1. Let’s name it ListOfT: >>> >>> >>> >>> >>> ListOfT = List[1] >>> >>> >>> >>> And then we can open it up: >>> >>> >>> >>> >>>

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-02 Thread Ivan Porto Carrero
n open it up: >> >> >> >> >>> module ListOfT >> >> ... def size >> >> ... count >> >> ... end >> >> ... end >> >> => nil >> >> >>> l = List[Fixnum].new >> >> =>

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-02 Thread Ryan Riley
> >>> l.size > > => 2 > > > > Tomas > > > > > > *From:* ironruby-core-boun...@rubyforge.org [mailto: > ironruby-core-boun...@rubyforge.org] *On Behalf Of *Orion Edwards > *Sent:* Monday, February 01, 2010 6:31 PM > *To:* ironruby-core@rub

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-02 Thread Orion Edwards
>> If you index System.Collections.Generic.List by a fixnum instead of a class/module you’ll get the generic definition of arity 1 Nice! I had no idea that feature existed ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/m

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-01 Thread Tomas Matousek
dwards Sent: Monday, February 01, 2010 6:31 PM To: ironruby-core@rubyforge.org Subject: Re: [Ironruby-core] A nicer syntax for generic extension methods IIRC you can open "concrete" generics, but not "open" ones: In plain english this means you can add methods to List but not Lis

Re: [Ironruby-core] A nicer syntax for generic extension methods

2010-02-01 Thread Orion Edwards
IIRC you can open "concrete" generics, but not "open" ones: In plain english this means you can add methods to List but not List. This is essentially because List isn't a real type in the CLR, it's basically some metadata that can be used to build a real type when the T is supplied. You could as