Changeset 2822 in project
- Timestamp:
- 01/11/07 01:06:25 (14 years ago)
- Location:
- bloom-filter
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bloom-filter/bloom-filter.scm
r1898 r2822 15 15 ;; - No ability to add message-digest-primitives at runtime. 16 16 17 (use srfi-9iset message-digest hash-utils lookup-table misc-extn mathh-int)17 (use iset message-digest hash-utils lookup-table misc-extn mathh-int) 18 18 19 19 (eval-when (compile) … … 23 23 (generic) 24 24 (inline) 25 (no-procedure-checks) 26 (no-bound-checks) 25 27 (constant 26 28 bloom-filter:optimum-k … … 45 47 bloom-filter-p-false-positive 46 48 bloom-filter-set! 47 bloom-filter-exists?) 48 ) 49 50 (cond-expand 51 [paranoia] 52 [else 53 (declare 54 (no-procedure-checks) 55 #;(no-argc-checks) 56 (no-bound-checks))] 57 ) 58 ) 49 bloom-filter-exists?) ) ) 59 50 60 51 ;;; -
bloom-filter/setup-header.scm
r2651 r2822 13 13 14 14 (define (->symbol obj) 15 15 (if (string? obj) (string->symbol obj) obj) ) 16 16 17 17 (define (make-filename bn . en) … … 35 35 (define (parse-optionals opt) 36 36 37 38 37 #;(define (string-drop-first str) 38 (list->string (cdr (string->list str))) ) 39 39 40 41 40 #;(define (symbol-drop-first sym) 41 (string->symbol (string-drop-first (symbol->string sym))) ) 42 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 43 (let ([cmp-args '()] [rqr@run '()] [opt-args '()]) 44 (let loop ([lst opt]) 45 (if (null? lst) 46 (values (reverse cmp-args) rqr@run opt-args) 47 (let ([itm (car lst)]) 48 (cond 49 [(pair? itm) 50 (if (eq? 'require-at-runtime (car itm)) 51 (set! rqr@run (append (cdr itm) rqr@run)) 52 (set! opt-args (cons itm opt-args)) )] 53 [(symbol? itm) 54 (if (char=? #\+ (string-ref (symbol->string itm) 0)) 55 (switch itm 56 ['+easyffi 57 (when needs-easyffi? 58 (set! cmp-args (append '(easyffi -extend) cmp-args)) )] 59 ['+dollar 60 (when needs-dollar? 61 (set! cmp-args (append '(dollar -extend) cmp-args)) )] 62 #;[else 63 (set! cmp-args (append `(,(symbol-drop-first itm) -extend) cmp-args))] ) 64 (set! cmp-args (cons itm cmp-args)) )] 65 [(atom? itm) 66 (set! cmp-args (cons itm cmp-args))] 67 [else 68 (set! opt-args (cons itm opt-args))]) 69 (loop (cdr lst)) )) ) ) ) 70 70 71 71 ;;; 72 72 73 73 (define-macro (copy-to-repository FN) 74 75 76 74 `(copy-file 75 (->string ,FN) 76 (make-repository-pathname (->string ,FN))) ) 77 77 78 78 (define-macro (compile-dynld DYN . OPT) 79 80 81 82 83 84 85 79 `(compile 80 -s 81 -O2 -d1 82 ,(make-source-filename DYN) 83 -o ,(make-dynld-filename DYN) 84 ,@(if has-exports? `(-check-imports -emit-exports ,(make-exports-filename DYN)) '()) 85 ,@OPT) ) 86 86 87 87 (define-macro (install-dynld DYN VER . OPT) 88 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 89 `(begin 90 (compile-dynld ,DYN ,@CMP-ARGS) 91 (install-extension ',(->symbol DYN) 92 '( 93 ,(make-dynld-filename DYN) 94 ) 95 '( 96 ,@OPT-ARGS 97 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 98 (version ,VER) 99 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) 100 ) ) ) ) ) 88 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 89 `(begin 90 (compile-dynld ,DYN ,@CMP-ARGS) 91 (install-extension ',(->symbol DYN) 92 '( 93 ,(make-dynld-filename DYN) ) 94 '( 95 ,@OPT-ARGS 96 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 97 (version ,VER) 98 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) ) ) ) ) ) 101 99 102 100 (define-macro (install-dynld+docu DYN VER . OPT) 103 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 104 `(begin 105 (compile-dynld ,DYN ,@CMP-ARGS) 106 (install-extension ',(->symbol DYN) 107 '( 108 ,(make-dynld-filename DYN) 109 ,(make-docu-filename DYN) 110 ) 111 '( 112 ,@OPT-ARGS 113 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 114 (documentation ,(make-docu-filename DYN)) 115 (version ,VER) 116 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) 117 ) ) ) ) ) 101 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 102 `(begin 103 (compile-dynld ,DYN ,@CMP-ARGS) 104 (install-extension ',(->symbol DYN) 105 '( 106 ,(make-dynld-filename DYN) 107 ,(make-docu-filename DYN) ) 108 '( 109 ,@OPT-ARGS 110 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 111 (documentation ,(make-docu-filename DYN)) 112 (version ,VER) 113 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) ) ) ) ) ) 118 114 119 115 (define-macro (install-syntax SYN VER . OPT) 120 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 121 `(install-extension ',(->symbol SYN) 122 '( 123 ,(make-source-filename SYN) 124 ) 125 '( 126 ,@OPT-ARGS 127 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 128 (version ,VER) 129 (syntax) 130 ) ) ) ) 116 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 117 `(install-extension ',(->symbol SYN) 118 '( 119 ,(make-source-filename SYN) ) 120 '( 121 ,@OPT-ARGS 122 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 123 (version ,VER) 124 (syntax) ) ) ) ) 131 125 132 126 (define-macro (install-syntax+docu SYN VER . OPT) 133 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 134 `(install-extension ',(->symbol SYN) 135 '( 136 ,(make-source-filename SYN) 137 ,(make-docu-filename SYN) 138 ) 139 '( 140 ,@OPT-ARGS 141 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 142 (version ,VER) 143 (documentation ,(make-docu-filename SYN)) 144 (syntax) 145 ) ) ) ) 127 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 128 `(install-extension ',(->symbol SYN) 129 '( 130 ,(make-source-filename SYN) 131 ,(make-docu-filename SYN) ) 132 '( 133 ,@OPT-ARGS 134 ,@(if (null? RQR@RUN) '() `((require-at-runtime ,@RQR@RUN))) 135 (version ,VER) 136 (documentation ,(make-docu-filename SYN)) 137 (syntax) ) ) ) ) 146 138 147 139 (define-macro (install-dynld+syntax SYN DYN VER . OPT) 148 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 149 `(begin 150 (compile-dynld ,DYN ,@CMP-ARGS) 151 (install-extension ',(->symbol SYN) 152 '( 153 ,(make-source-filename SYN) 154 ,(make-dynld-filename DYN) 155 ) 156 '( 157 ,@OPT-ARGS 158 (syntax) 159 (require-at-runtime ,(->symbol DYN) ,@RQR@RUN) 160 (version ,VER) 161 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) 162 ) ) ) ) ) 140 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 141 `(begin 142 (compile-dynld ,DYN ,@CMP-ARGS) 143 (install-extension ',(->symbol SYN) 144 '( 145 ,(make-source-filename SYN) 146 ,(make-dynld-filename DYN) ) 147 '( 148 ,@OPT-ARGS 149 (syntax) 150 (require-at-runtime ,(->symbol DYN) ,@RQR@RUN) 151 (version ,VER) 152 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) ) ) ) ) ) 163 153 164 154 (define-macro (install-dynld+syntax+docu SYN DYN VER . OPT) 165 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 166 `(begin 167 (compile-dynld ,DYN ,@CMP-ARGS) 168 (install-extension ',(->symbol SYN) 169 '( 170 ,(make-docu-filename SYN) 171 ,(make-source-filename SYN) 172 ,(make-dynld-filename DYN) 173 ) 174 '( 175 ,@OPT-ARGS 176 (documentation ,(make-docu-filename SYN)) 177 (syntax) 178 (require-at-runtime ,(->symbol DYN) ,@RQR@RUN) 179 (version ,VER) 180 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) 181 ) ) ) ) ) 155 (let-values (([CMP-ARGS RQR@RUN OPT-ARGS] (parse-optionals OPT))) 156 `(begin 157 (compile-dynld ,DYN ,@CMP-ARGS) 158 (install-extension ',(->symbol SYN) 159 '( 160 ,(make-docu-filename SYN) 161 ,(make-source-filename SYN) 162 ,(make-dynld-filename DYN) ) 163 '( 164 ,@OPT-ARGS 165 (documentation ,(make-docu-filename SYN)) 166 (syntax) 167 (require-at-runtime ,(->symbol DYN) ,@RQR@RUN) 168 (version ,VER) 169 ,@(if has-exports? `((exports ,(make-exports-filename DYN))) '()) ) ) ) ) )
Note: See TracChangeset
for help on using the changeset viewer.