Overview
Comment: | fix typo |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ec168497f7c0af7993a1a8a85c2bd1f9 |
User & Date: | lexi on 2019-07-27 06:30:17 |
Other Links: | manifest | tags |
Context
2019-08-13
| ||
20:35 | drugbot update check-in: 19d49add51 user: lexi tags: trunk | |
2019-07-27
| ||
06:30 | fix typo check-in: ec168497f7 user: lexi tags: trunk | |
06:29 | add structure macro check-in: e856b9f3a8 user: lexi tags: trunk | |
Changes
Modified lib/struct.scm from [7cd42aa5f2] to [9011b1b988].
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
`((: ,name (#!rest (or symbol ,@(uniq types)) --> ,name ))
(define (,name . args)
(define (safe-vector-ref v i) (if (null? v) (error "all struct fields need to be specified unless functional record update syntax is in use")
(vector-ref v i)))
(let* ([basis (if (,(symsuf name "?") (car args)) (cdar args) '())]
[spec (if (null? basis) args (cdr args))])
(cons (quote ,typesym)
(vector ,@(reduce-flds 0 fields)
))))))
(let* ([name (car body)]
[fields (cdr body)]
[typesym (gensym)]
[types (map extract-type fields)])
(append (emit-pred name typesym)
(emit-def name types)
(emit-gen name types typesym fields)
(reduce-fields name 0 fields))))
|
| < < |
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
`((: ,name (#!rest (or symbol ,@(uniq types)) --> ,name ))
(define (,name . args)
(define (safe-vector-ref v i) (if (null? v) (error "all struct fields need to be specified unless functional record update syntax is in use")
(vector-ref v i)))
(let* ([basis (if (,(symsuf name "?") (car args)) (cdar args) '())]
[spec (if (null? basis) args (cdr args))])
(cons (quote ,typesym)
(vector ,@(reduce-flds 0 fields)))))))
(let* ([name (car body)]
[fields (cdr body)]
[typesym (gensym)]
[types (map extract-type fields)])
(append (emit-pred name typesym)
(emit-def name types)
(emit-gen name types typesym fields)
(reduce-fields name 0 fields))))
|