From 5d5b2cc1ac7d999d1495a1563cce7e306d3dc956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 21 Mar 2019 01:17:20 +0100 Subject: Update utility functions. --- util.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'util.scm') diff --git a/util.scm b/util.scm index 672f1ddc..d19bdc85 100644 --- a/util.scm +++ b/util.scm @@ -3,7 +3,7 @@ #:export (destructure-lambda let-multi fold-lists catch-let for-each-in define-quick-record define-quick-record! - mod! sort*) + mod! sort* sort*!) #:replace (let*) ) @@ -119,3 +119,10 @@ (sort items (lambda (a b) (comperator (get a) (get b))))) + +;;; This function borrowed from web-ics (calendar util) +(define* (sort*! items comperator #:optional (get identity)) + "A sort function more in line with how python's sorted works" + (sort! items (lambda (a b) + (comperator (get a) + (get b))))) -- cgit v1.2.3