Improve macro
This commit is contained in:
parent
17d9c17d9f
commit
8681daf54a
1 changed files with 7 additions and 5 deletions
|
@ -5,7 +5,7 @@
|
|||
|
||||
(define-syntax define-view
|
||||
(lambda (x)
|
||||
(syntax-case x (with)
|
||||
(syntax-case x ()
|
||||
((_ name doc fmt fields fields* ...)
|
||||
(with-syntax ((viewname
|
||||
(datum->syntax
|
||||
|
@ -14,11 +14,13 @@
|
|||
(define (viewname)
|
||||
doc
|
||||
(map (lambda (item)
|
||||
(let (#,@(map (lambda (field)
|
||||
#`(#,field (cdr (assq (quote #,field) item))))
|
||||
#'(fields fields* ...)))
|
||||
(format #t fmt
|
||||
#,@(map
|
||||
(lambda (field)
|
||||
#`(cdr (assq (quote #,field) item)))
|
||||
#'(fields fields* ...))))
|
||||
#,@(map (lambda (field)
|
||||
field)
|
||||
#'(fields fields* ...)))))
|
||||
todo-list))
|
||||
(set! view-list
|
||||
(append view-list
|
||||
|
|
Loading…
Reference in a new issue