add in- iterators

pull/27/head
Matthew Butterick 10 years ago
parent 3af6bed401
commit c704a85b13

@ -221,7 +221,7 @@
;; todo: should this test be not block + not whitespace? ;; todo: should this test be not block + not whitespace?
(define not-block? (λ(i) (not (block-txexpr? i)))) (define not-block? (λ(i) (not (block-txexpr? i))))
(filter-not empty? (filter-not empty?
(for/list ([i (len xc)]) (for/list ([i (in-range (len xc))])
(let ([item (get xc i)]) (let ([item (get xc i)])
(cond (cond
;; skip first and last ;; skip first and last

@ -44,8 +44,8 @@ if zero is False:
(match x (match x
[`(,tag ([,ks ,vs] ...) . ,els) [`(,tag ([,ks ,vs] ...) . ,els)
`(,tag `(,tag
,(for/list ([k ks] ,(for/list ([k (in-value ks)]
[v vs]) [v (in-value vs)])
(list k (regexp-replace* "&" v "\\&"))) (list k (regexp-replace* "&" v "\\&")))
,@(map decode-ampersands-in-attributes els))] ,@(map decode-ampersands-in-attributes els))]
[v v])) [v v]))

@ -154,7 +154,7 @@
(explode-path (find-relative-path (world:current-project-root) dashboard-dir)) (explode-path (find-relative-path (world:current-project-root) dashboard-dir))
null))) null)))
(define dirlinks (cons "/" (map (λ(ps) (format "/~a/" (apply build-path ps))) (define dirlinks (cons "/" (map (λ(ps) (format "/~a/" (apply build-path ps)))
(for/list ([i (length (cdr dirs))]) (for/list ([i (in-range (length (cdr dirs)))])
(take (cdr dirs) (add1 i)))))) (take (cdr dirs) (add1 i))))))
`(tr (th ((colspan "3")) ,@(add-between (map (λ(dir dirlink) `(a ((href ,(format "~a~a" dirlink world:default-pagetree))) ,(->string dir))) dirs dirlinks) "/")))) `(tr (th ((colspan "3")) ,@(add-between (map (λ(dir dirlink) `(a ((href ,(format "~a~a" dirlink world:default-pagetree))) ,(->string dir))) dirs dirlinks) "/"))))

Loading…
Cancel
Save