Пример #1
0
        /// <summary>
        /// Recursions the get files.
        /// </summary>
        /// <remark>Author : PetterLiu 2009-03-29 11:27  http://wintersun.cnblogs.com </remark>
        public void RecursionGetFiles()
        {
            var RecGetFiles =
                Functional.Y <string, IEnumerable <string> >
                    (f => d => Directory.GetFiles(d).Concat(Directory.GetDirectories(d).SelectMany(f)));

            foreach (var f in RecGetFiles(Directory.GetCurrentDirectory()))
            {
                Console.WriteLine(f);
            }
        }
Пример #2
0
        /// <summary>
        /// Factorial2s this instance.
        /// </summary>
        /// <remark>Author : PetterLiu 2009-03-29 11:28  http://wintersun.cnblogs.com </remark>
        public void Factorial2()
        {
            var dd = Functional.Y <int, int>(h => m => (m == 1) ? 1 : h(m - 1) * m);

            Console.WriteLine(dd(5));
        }