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))); }
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); } } }
public static Cons SortBy(IApply key, IApply comparer, IEnumerable seq) { return(AsLazyList(SeqBase.Sort(seq, comparer, key))); }
public static Cons Sort(IApply comparer, IEnumerable seq) { return(AsLazyList(SeqBase.Sort(seq, comparer, IdentityApply))); }