diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-17 20:28:48 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-08-18 16:38:37 +0200 |
commit | 907931e62d154564089a2e88145d56afa68231fa (patch) | |
tree | 67a27bdc54b34a815eee12b76ceedf71c3c61e06 /scripts/module-introspection.scm | |
parent | Up-prioritize api change for group-by. (diff) | |
download | calp-907931e62d154564089a2e88145d56afa68231fa.tar.gz calp-907931e62d154564089a2e88145d56afa68231fa.tar.xz |
Add uniq family of procedures.c-parser
Diffstat (limited to '')
-rw-r--r-- | scripts/module-introspection.scm | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/scripts/module-introspection.scm b/scripts/module-introspection.scm index dc430d8a..17068371 100644 --- a/scripts/module-introspection.scm +++ b/scripts/module-introspection.scm @@ -2,7 +2,6 @@ :use-module (srfi srfi-1) :use-module (hnh util) :export (get-forms - uniq unique-symbols find-module-declaration module-declaration? @@ -16,23 +15,11 @@ done (loop (cons form done)))))) - -(define (uniq lst) - (cond ((null? lst) lst) - ((null? (cdr lst)) lst) - ((and (pair? lst) - (eqv? (car lst) (cadr lst))) - (uniq (cons (car lst) (cddr lst)))) - (else (cons (car lst) - (uniq (cdr lst)))))) - - (define (unique-symbols tree) - (uniq + (univ (sort* (filter symbol? (flatten tree)) string<? symbol->string))) - (define (module-declaration? form) (cond ((null? form) #f) ((not (pair? form)) #f) |