|
63 | 63 | (cond |
64 | 64 | [(boolean? method) (boolean->symbol method)] |
65 | 65 | [(symbol? method) |
66 | | - (if (not (equal? method 'recursive)) |
67 | | - (raise-argument-error 'submodule "boolean? or 'recursive" method) |
68 | | - method)]))) |
| 66 | + (unless (equal? method 'recursive) |
| 67 | + (raise-argument-error 'submodule "boolean? or 'recursive" method)) |
| 68 | + method]))) |
69 | 69 |
|
70 | 70 | (define/contract (copy-repo? val) |
71 | 71 | (-> boolean? src-option?) |
|
82 | 82 | (define/contract (tbl url #:options [options null]) |
83 | 83 | (->* (string?) (#:options (listof src-option?)) src?) |
84 | 84 | (define allowed-options '(rename)) |
85 | | - (for-each (λ (opt) |
86 | | - (when (not (member (src-option-field opt) allowed-options)) |
87 | | - (raise-user-error 'tbl |
88 | | - "~a option is not allowed in tbl source" |
89 | | - (src-option-field opt)))) |
90 | | - options) |
| 85 | + (for ([opt (in-list options)] |
| 86 | + #:when (not (member (src-option-field opt) allowed-options))) |
| 87 | + (raise-user-error 'tbl "~a option is not allowed in tbl source" (src-option-field opt))) |
91 | 88 | (src 'tbl options url)) |
92 | 89 |
|
93 | 90 | (define/contract (src->string src) |
|
228 | 225 | (when (and (hash? srcs) |
229 | 226 | (not (equal? (hash-keys srcs #t) (hash-keys chksums #t)))) |
230 | 227 | (raise-user-error 'spec "SRCS and CHKSUMS have mismatching ARCH args")) |
231 | | - (when (not (if (list? srcs) |
232 | | - (equal? (length srcs) (length chksums)) |
233 | | - (andmap (λ (s c) (equal? (length s) (length c))) |
234 | | - (hash->list srcs #t) |
235 | | - (hash->list chksums #t)))) |
| 228 | + (unless (if (list? srcs) |
| 229 | + (equal? (length srcs) (length chksums)) |
| 230 | + (andmap (λ (s c) (equal? (length s) (length c))) |
| 231 | + (hash->list srcs #t) |
| 232 | + (hash->list chksums #t))) |
236 | 233 | (raise-user-error 'spec "SRCS and CHKSUMS length mismatch")) |
237 | 234 |
|
238 | 235 | ;; Final struct |
|
243 | 240 | (displayln (spec-entry->string "VER" (spec-type-ver spec)) out) |
244 | 241 | (when (spec-type-rel spec) |
245 | 242 | (displayln (spec-entry->string "REL" (spec-type-rel spec)) out)) |
246 | | - (when (not (spec-type-dummysrc? spec)) |
| 243 | + (unless (spec-type-dummysrc? spec) |
247 | 244 | (if (list? (spec-type-srcs spec)) |
248 | 245 | (displayln (srcs->string (spec-type-srcs spec)) out) |
249 | 246 | (for ([arch-srcs (hash->list (spec-type-srcs spec))]) |
250 | 247 | (displayln (srcs->string (cdr arch-srcs) (car arch-srcs)) out)))) |
251 | 248 | (when (spec-type-subdir spec) |
252 | 249 | (displayln (spec-entry->string "SUBDIR" (spec-type-subdir spec) #t) out)) |
253 | | - (when (not (spec-type-dummysrc? spec)) |
| 250 | + (unless (spec-type-dummysrc? spec) |
254 | 251 | (if (list? (spec-type-chksums spec)) |
255 | 252 | (displayln (chksums->string (spec-type-chksums spec)) out) |
256 | 253 | (for ([arch-chksums (hash->list (spec-type-chksums spec))]) |
257 | | - (displayln (chksums->string (cdr arch-chksums) (car arch-chksums)) |
258 | | - out)))) |
| 254 | + (displayln (chksums->string (cdr arch-chksums) (car arch-chksums)) out)))) |
259 | 255 | (when (spec-type-chkupdate spec) |
260 | 256 | (displayln (chkupdate->string (spec-type-chkupdate spec)) out)) |
261 | 257 | (when (spec-type-dummysrc? spec) |
|
0 commit comments