|
|
|
@ -5,6 +5,22 @@
|
|
|
|
|
@(define my-eval (make-base-eval))
|
|
|
|
|
@(my-eval `(require pollen pollen/setup))
|
|
|
|
|
|
|
|
|
|
@(require (for-syntax racket/base racket/syntax pollen/setup))
|
|
|
|
|
@(define-syntax (defoverridable stx)
|
|
|
|
|
(syntax-case stx ()
|
|
|
|
|
[(_ name predicate? desc ...)
|
|
|
|
|
(with-syntax* ([default-name (format-id #'here "default-~a" #'name)]
|
|
|
|
|
[value (let ([v (syntax-local-eval #'default-name)])
|
|
|
|
|
(cond
|
|
|
|
|
[(and (list? v) (andmap symbol? v) (> (length v) 5)) #`'#,'(see below)]
|
|
|
|
|
[(or (symbol? v) (list? v)) #`'#,v]
|
|
|
|
|
[(procedure? v) '(λ (path) #f)]
|
|
|
|
|
[else v]))]
|
|
|
|
|
[setup:name (format-id stx "setup:~a" #'name)])
|
|
|
|
|
#`(deftogether ((defproc (setup:name) predicate?)
|
|
|
|
|
(defthing default-name predicate? #:value value))
|
|
|
|
|
desc ...))]))
|
|
|
|
|
|
|
|
|
|
@title{Setup}
|
|
|
|
|
|
|
|
|
|
@defmodule[pollen/setup]
|
|
|
|
|