Skip to content

Commit

Permalink
Use define-syntax-parse-rule in table macro
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfirth committed Oct 10, 2024
1 parent f77e9df commit f1852a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions collection/table.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@
(define msg "cannot be used outside a table expression")
(raise-syntax-error 'row msg stx))

(define-simple-macro
(table ((~literal columns) column:keyword ...)
(~and full-row ((~literal row) row-value:expr ...)) ...)
(define-syntax-parse-rule (table ((~literal columns) column:keyword ...)
(~and full-row ((~literal row) row-value:expr ...)) ...)
#:do [(define column-keywords
(sort (map syntax-e (syntax->list #'(column ...))) keyword<?))
(define num-columns (length column-keywords))
Expand Down

0 comments on commit f1852a3

Please sign in to comment.