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
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
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
&
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
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
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
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
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
t;>>>>> System::Collections::IEnumerable, Enumerable, System::Collections::IList,
>>>>>> System::Collections::ICollection, System::Collections::Generic, Kernel]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
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]
>>>>
>>>>
>
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:
>>>
>>>
>>>
>>> >>>
n open it up:
>>
>>
>>
>> >>> module ListOfT
>>
>> ... def size
>>
>> ... count
>>
>> ... end
>>
>> ... end
>>
>> => nil
>>
>> >>> l = List[Fixnum].new
>>
>> =>
> >>> 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
>> 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
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
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
16 matches
Mail list logo