Update struct definition macro for conformed args
This commit is contained in:
parent
8ea6c27b38
commit
ebe36e199c
1 changed files with 1 additions and 3 deletions
|
|
@ -1166,9 +1166,7 @@
|
|||
;; TODO(Joshua): Support adding padding to the structure (and make it
|
||||
;; extensible?)
|
||||
(let [args (s/conform ::defstruct-args args)]
|
||||
`(let [struct-type# [::struct [~@(->> (:fields args)
|
||||
(partition 2)
|
||||
(map vector))]]]
|
||||
`(let [struct-type# [::struct ~(mapv (juxt :field-name :field-type) (:fields args))]]
|
||||
(defmethod c-layout ~(:struct-name args)
|
||||
[_type#]
|
||||
(c-layout struct-type#))
|
||||
|
|
|
|||
Loading…
Reference in a new issue