MS: Please release an assembly containing Func<> :)

The Func<> delegates are already useful, and are trivial to create on our own.  However, without some canonical distribution of them, there are going to be problems coordinating the use of them pre-Linq.

Would it be possible to release a live MS version of them, not bound into the Linq preview, to eventually be folded into the main framework, so we can all use the exact same namespace/version and not keep recreating things

Unless you've hidden them somewhere I haven't seen


Answer this question

MS: Please release an assembly containing Func<> :)

  • ZaDDaZ

    Add some Sub<> versions too


    delegate void Sub();
    delegate void Sub<A0>(A0 a0);
    delegate void Sub<A0, A1>(A0 a0, A1 a1);

     


    to handle void return types

  • StephenSaw

    Those are the creatures, but they're contained in an unreleased-for-primetime assembly, EULA-wise.


  • Angie28

    Sub would be an unfortunate name since it's a VB keyword.



  • Frosty1_4me

    SProc<> :-)



  • James Downey

    And "VoidFunc" sounds like a 80s Berlin techno group... :)



  • gcs_78

    Action<> will do better, as it will be consistent with already defined System.Action<T>.


    delegate void Action();
    delegate void Action<A>(A a);
    delegate void Action<A, B>(A a, B b);

     

    Btw, in the very same way these delegates are defined in ECMA TR/89 http://www.ecma-international.org/publications/files/ECMA-TR/TR-089.pdf



  • whoknowswhat

    var et = new Sproc();
    if (et.Wet) et.Toad();

  • CraigGuyer

    Kieth,
    These should be in System.Query.dll when you install the LINQ Preview. You can see the sources in sequence.cs which we also install with the LINQ Preview. Is this what you're looking for

    namespace System.Query {
    public
    delegate T Func<T>();
    public delegate T Func<A0, T>(A0 arg0);
    public delegate T Func<A0, A1, T>(A0 arg0, A1 arg1);
    public delegate T Func<A0, A1, A2, T>(A0 arg0, A1 arg1, A2 arg2);
    public delegate T Func<A0, A1, A2, A3, T>(A0 arg0, A1 arg1, A2 arg2, A3 arg3);


  • Andrius

    Valid concern. But we don't have another release vehicle - having just released VS 2005 (and .NET Framework 2.0) short of these previews and forthcoming CTPs :-(

  • andyr2005

    Oh, yeah. VB. ;)  Heh I was a VB developer once upon a time.
    How about "Routine<>"

  • MS: Please release an assembly containing Func<> :)