Skip to content

Commit

Permalink
Add for/s macro
Browse files Browse the repository at this point in the history
  • Loading branch information
otherjoel committed Jul 10, 2018
1 parent a62244a commit 1a90ac6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pollen.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(require pollen/decode
pollen/setup ; For current-poly-target
pollen/file ; get-markup-source
pollen/core
txexpr
pollen/tag ; default-tag-function
"util-date.rkt"
Expand All @@ -16,6 +17,7 @@
(all-from-out "util-date.rkt" "util-template.rkt" "util-db.rkt")
(all-from-out "pollen-local/tags-pdf.rkt"))
(provide (all-defined-out))
(provide for/s)

(module setup racket/base
(provide (all-defined-out))
Expand Down Expand Up @@ -79,3 +81,8 @@
(define (amazon product-id . contents)
(define affiliate-id "thloya-20")
(apply link (format "https://amzn.com/~a/?tag=~a" product-id affiliate-id) contents))

(define-syntax (for/s stx)
(syntax-case stx ()
[(_ thing listofthings result-expr ...)
#'(for/splice ([thing (in-list listofthings)]) result-expr ...)]))

0 comments on commit 1a90ac6

Please sign in to comment.