예제 #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
파일: seq.cs 프로젝트: lkonings/kiezellisp
 public static Cons SortBy(IApply key, IApply comparer, IEnumerable seq)
 {
     return(AsLazyList(SeqBase.Sort(seq, comparer, key)));
 }
예제 #4
0
파일: seq.cs 프로젝트: lkonings/kiezellisp
 public static Cons Sort(IApply comparer, IEnumerable seq)
 {
     return(AsLazyList(SeqBase.Sort(seq, comparer, IdentityApply)));
 }