summaryrefslogtreecommitdiff
path: root/scheme/guile/geiser/utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/guile/geiser/utils.scm')
-rw-r--r--scheme/guile/geiser/utils.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/scheme/guile/geiser/utils.scm b/scheme/guile/geiser/utils.scm
index 01dfaa0..632fe76 100644
--- a/scheme/guile/geiser/utils.scm
+++ b/scheme/guile/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))))