Changeset 38257 in project


Ignore:
Timestamp:
03/14/20 19:04:33 (3 weeks ago)
Author:
Kon Lovett
Message:

better names, update db

Location:
release/5/apropos-srfi/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/5/apropos-srfi/trunk/apropos-srfi-csi.scm

    r36147 r38257  
    1919  (only (chicken port) with-input-from-string)
    2020  (only (srfi 1) every)
    21   (only apropos-srfi srfi-info srfi-srfis)
     21  (only apropos-srfi srfi-info srfis->alist)
    2222  (only memoized-string make-string+)
    2323  (only feature-utils sorted-feature-srfis)
     
    7878        ((number? arg)  args)
    7979        ((not arg)      (srfi-features))
    80         (else           (srfi-srfis)))) )
     80        (else           (srfis->alist)))) )
    8181    (for-each present-srfi-info srfis) ) )
    8282
  • release/5/apropos-srfi/trunk/apropos-srfi-db.scm

    r35818 r38257  
    99;;
    1010;; - have db in file
     11;;
     12;; - toolchain to build db from HTML
    1113
    1214(module apropos-srfi-db
     
    6163  ((srfi . 21) (title . "Real-time multithreading support") (author . ("Marc Feeley")) (status . final) (date . "2001/3/2") (keyword . ("Concurrency")) (ref . ()))
    6264  ((srfi . 22) (title . "Running Scheme Scripts on Unix") (author . ("Martin Gasbichler" "Michael Sperber")) (status . final) (date . "2002/1/20") (keyword . ("Operating System")) (ref . ()))
    63   ((srfi . 23) (title . "Error reporting mechanism") (author . ("Stephan Houben")) (status . final) (date . "2001/6/22") (keyword . ("Control Flow, Error Handling")) (ref . ()))
     65  ((srfi . 23) (title . "Error reporting mechanism") (author . ("Stephan Houben")) (status . final) (date . "2001/6/22") (keyword . ("Control Flow" "Error Handling")) (ref . ()))
    6466  ((srfi . 24) (title . "Define-syntax in local lexical scopes") (author . ("Antti Huima")) (status . withdrawn) (date . "2002/04/12") (keyword . ("Syntax")) (ref . ()))
    6567  ((srfi . 25) (title . "Multi-dimensional Array Primitives") (author . ("Jussi Piitulainen")) (status . final) (date . "2002/5/21") (keyword . ("Data Structure")) (ref . ()))
     
    124126  ((srfi . 84) (title . "Universal Identifiers") (author . ("Andrew Wilcox")) (status . withdrawn) (date . "2006/11/09") (keyword . ("Data Structure")) (ref . ()))
    125127  ((srfi . 85) (title . "Recursive Equivalence Predicates") (author . ("William D Clinger")) (status . withdrawn) (date . "2006/10/21") (keyword . ("Comparison")) (ref . ()))
    126   ((srfi . 86) (title . "MU and NU simulating VALUES & CALL-WITH-VALUES, and their related LET-syntax") (author . ("Joo ChurlSoo")) (status . final) (date . "2006/6/20") (keyword . ("Data Structure, Multiple Value Returns")) (ref . ()))
     128  ((srfi . 86) (title . "MU and NU simulating VALUES & CALL-WITH-VALUES, and their related LET-syntax") (author . ("Joo ChurlSoo")) (status . final) (date . "2006/6/20") (keyword . ("Data Structure" "Multiple Value Returns")) (ref . ()))
    127129  ((srfi . 87) (title . "=> in case clauses") (author . ("Chongkai Zhu")) (status . final) (date . "2006/10/18") (keyword . ("Control Flow")) (ref . ()))
    128130  ((srfi . 88) (title . "Keyword objects") (author . ("Marc Feeley")) (status . final) (date . "2007/7/3") (keyword . ("Reader Syntax")) (ref . ()))
     
    193195  ((srfi . 153) (title . "Ordered Sets") (author . ("John Cowan")) (status . Draft) (date . "2017/6/28") (keyword . ("Data Structure")) (ref . ()))
    194196  ((srfi . 154) (title . "First-class dynamic extents") (author . ("Marc Nieper-Wißkirchen")) (status . Draft) (date . "2017/7/3") (keyword . ("Miscellaneous")) (ref . ()))
    195   ((srfi . 155) (title . "Promises") (author . ("Marc Nieper-Wißkirchen")) (status . Draft) (date . "2017/7/4") (keyword . ("Data Structure, Lazy Evaluation")) (ref . (45)))
     197  ((srfi . 155) (title . "Promises") (author . ("Marc Nieper-Wißkirchen")) (status . Draft) (date . "2017/7/4") (keyword . ("Data Structure" "Lazy Evaluation")) (ref . (45)))
    196198  ((srfi . 156) (title . "Syntactic combiners for binary predicates") (author . ("Panicz Maciej Godek")) (status . final) (date . "2017/12/18") (keyword . ("Syntax")) (ref . (26)))
    197199  ((srfi . 157) (title . "Continuation marks") (author . ("Marc Nieper-Wißkirchen")) (status . final) (date . "2018/1/29") (keyword . ("Continuations")) (ref . ()))
  • release/5/apropos-srfi/trunk/apropos-srfi.scm

    r35818 r38257  
    1313
    1414(;export
    15   srfi-srfis
     15  srfi-numbers
    1616  srfi-info
    17   srfi-alist)
     17  srfis->alist)
    1818
    1919(import scheme
     
    2424  apropos-srfi-db)
    2525
    26 ;;
     26;;;
    2727
    2828(define-type alist (list-of pair))
     
    3030;;
    3131
    32 #| ;UNUSED
    33 (: sort-alist (alist #!optional procedure --> alist))
    34 ;
    35 (define (sort-alist xs #!optional (p? <))
    36   (sort xs (lambda (a b) (p? (car a) (car b)))) )
    37 |#
    38 
    3932(: index-alist! (hash-table * alist #!optional procedure -> void))
    4033;
    41 (define (index-alist! idx key xs #!optional (eql? eq?))
     34(define (index-alist! ht key xs #!optional (eql? eq?))
    4235  (for-each
    4336    (lambda (item)
     
    4538        ;multi-valued
    4639        (if (pair? val)
    47           (for-each (cut hash-table-set! idx <> item) val)
    48           (hash-table-set! idx val item) ) ) )
     40          (for-each (cut hash-table-set! ht <> item) val)
     41          (hash-table-set! ht val item) ) ) )
    4942    xs) )
    5043
    5144;;
    5245
    53 (define +srfis+ (srfi-info-list))
    54 
    55 (define +srfis-index-srfi+
    56   (let (
    57     (idx (make-hash-table fx= number-hash)) )
    58     (index-alist! idx 'srfi +srfis+)
    59     idx))
    60 
    61 (define +srfi-srfis+ (map (cut alist-ref 'srfi <> eq?) +srfis+))
     46(define +srfis-map+)
     47(define +srfi-numbers+)
     48(let ((+db+ (srfi-info-list)))
     49  (set! +srfis-map+
     50    (let ((ht (make-hash-table fx= number-hash)))
     51      (index-alist! ht 'srfi +db+)
     52      ht))
     53  (set! +srfi-numbers+
     54    (map (cut alist-ref 'srfi <> eq?) +db+)) )
    6255
    6356;;
    6457
    65 (: srfi-srfis (-> (list-of fixnum)))
     58(: srfi-numbers (-> (list-of fixnum)))
    6659;
    67 (define (srfi-srfis)
    68   +srfi-srfis+ )
     60(define (srfi-numbers)
     61  +srfi-numbers+ )
    6962
    7063(: srfi-info (fixnum -> alist))
    7164;
    7265(define (srfi-info n)
    73   (hash-table-ref/default +srfis-index-srfi+ n #f) )
     66  (hash-table-ref/default +srfis-map+ n #f) )
    7467
    75 (: srfi-alist (#!optional (or boolean (list-of fixnum)) -> (list-of (pair fixnum alist))))
     68(: srfis->alist (#!optional (or boolean (list-of fixnum)) -> (list-of (pair fixnum alist))))
    7669;
    77 (define (srfi-alist #!optional (wanted #t))
     70(define (srfis->alist #!optional (wanted #t))
    7871  (cond
    7972    ((pair? wanted)
    8073      (map (lambda (n) (cons n (srfi-info n))) wanted) )
    8174    (wanted
    82       (hash-table->alist +srfis-index-srfi+) )
     75      (hash-table->alist +srfis-map+) )
    8376    (else
    8477      '() ) ) )
  • release/5/apropos-srfi/trunk/tests/apropos-srfi-test.scm

    r35818 r38257  
    88
    99(test-assert (srfi-info 0))
    10 (test-assert (equal? (srfi-alist) (srfi-alist '())))
    11 (test-assert (eq? 2 (length (srfi-alist '(1 2)))))
    12 (test-assert (pair? (srfi-alist #t)))
    13 (test-assert (null? (srfi-alist #f)))
     10(test-assert (equal? (srfis->alist) (srfis->alist '())))
     11(test-assert (eq? 2 (length (srfis->alist '(1 2)))))
     12(test-assert (pair? (srfis->alist #t)))
     13(test-assert (null? (srfis->alist #f)))
    1414
    1515;;;
Note: See TracChangeset for help on using the changeset viewer.