Пример #1
0
        public static Cons Sort(IEnumerable seq, params object[] args)
        {
            var kwargs = ParseKwargs(args, new string[] { "test", "key" });
            var test   = GetClosure(kwargs[0], CompareApply);
            var key    = GetClosure(kwargs[1]);

            return(AsLazyList(SeqBase.Sort(seq, test, key)));
        }
Пример #2
0
 public static void DumpDictionary(object stream, PrototypeDictionary dict)
 {
     if (dict != null)
     {
         foreach (var key in ToIter(SeqBase.Sort(dict.Keys, CompareApply, IdentityApply)))
         {
             object val  = dict[key];
             string line = string.Format("{0} => ", key);
             Write(line, Symbols.Escape, false, Symbols.Stream, stream);
             PrettyPrintLine(stream, line.Length, null, val);
         }
     }
 }
Пример #3
0
 public static Cons SortBy(IApply key, IApply comparer, IEnumerable seq)
 {
     return(AsLazyList(SeqBase.Sort(seq, comparer, key)));
 }
Пример #4
0
 public static Cons Sort(IApply comparer, IEnumerable seq)
 {
     return(AsLazyList(SeqBase.Sort(seq, comparer, IdentityApply)));
 }