diff options
Diffstat (limited to 'geiser/utils.scm')
-rw-r--r-- | geiser/utils.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/geiser/utils.scm b/geiser/utils.scm index 01dfaa0..632fe76 100644 --- a/geiser/utils.scm +++ b/geiser/utils.scm @@ -14,6 +14,7 @@ symbol->object pair->list sort-symbols! + make-symbol-sort gensym?) #:use-module (ice-9 regex)) @@ -37,6 +38,13 @@ (string<? (symbol->string l) (symbol->string r))))) (sort! syms cmp))) +(define (make-symbol-sort sel) + (let ((cmp (lambda (a b) + (string<? (symbol->string (sel a)) + (symbol->string (sel b)))))) + (lambda (syms) + (sort! syms cmp)))) + (define (gensym? sym) (and (symbol? sym) (gensym-name? (format "~A" sym)))) |