From 5384fef66e927a3e5c149234f9c952160b8bdf38 Mon Sep 17 00:00:00 2001 From: Sam TH Date: Sun, 18 Apr 2010 21:58:20 -0400 Subject: [PATCH] forgot to add this file --- collects/rico/all-tools.ss | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 collects/rico/all-tools.ss diff --git a/collects/rico/all-tools.ss b/collects/rico/all-tools.ss new file mode 100644 index 0000000000..5dff66d18e --- /dev/null +++ b/collects/rico/all-tools.ss @@ -0,0 +1,39 @@ +#lang scheme/base + +(require setup/getinfo) +(provide all-tools) + +(define (all-tools) + (let* ([dirs (find-relevant-directories '(rico))] + [tools (make-hash)]) + (for ([i (in-list (map get-info/full dirs))] + [d (in-list dirs)]) + (let ([entries (let ([l (i 'rico (lambda () null))]) + (if (list? l) + l + (list l)))]) + (for ([entry (in-list entries)]) + (cond + [(and (list? entry) + (= (length entry) 4) + (string? (car entry)) + (module-path? (cadr entry)) + (string? (caddr entry)) + (or (not (list-ref entry 3)) + (real? (list-ref entry 3)))) + (let ([p (hash-ref tools (car entry) #f)]) + (when p + (fprintf + (current-error-port) + "warning: tool ~s registered twice: ~e and ~e" + (car entry) + (car p) + d))) + (hash-set! tools (car entry) entry)] + [else + (fprintf + (current-error-port) + "warning: ~s provided bad `rico' spec: ~e" + d + entry)])))) + tools))