コード例 #1
0
 internal static IEnumerable <T> Where <T>(this IEnumerable <T> enumerable, Microsoft.Scripting.Utils.Func <T, bool> where)
 {
     foreach (T t in enumerable)
     {
         if (where (t))
         {
             yield return(t);
         }
     }
 }
コード例 #2
0
 internal static bool Any <T>(this IEnumerable <T> source, Microsoft.Scripting.Utils.Func <T, bool> predicate)
 {
     foreach (T element in source)
     {
         if (predicate(element))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
        // Need to reproduce these helpers from DLR codeplex-only sources and
        // from LINQ functionality to avoid referencing System.Core.dll and
        // Microsoft.Scripting.Core.dll for internal building.

        internal static IEnumerable <U> Select <T, U>(this IEnumerable <T> enumerable, Microsoft.Scripting.Utils.Func <T, U> select)
        {
            foreach (T t in enumerable)
            {
                yield return(select(t));
            }
        }
コード例 #4
0
ファイル: DynInitHelper.cs プロジェクト: terkhorn/clojure-clr
        // From Microsoft.Scripting.Utils.CollectionExtensions
        // Name needs to be different so it doesn't conflict with Enumerable.Select
#if CLR2
        internal static U[] Map <T, U>(this ICollection <T> collection, Microsoft.Scripting.Utils.Func <T, U> select)