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
|
;; TODO(Joshua): Support adding padding to the structure (and make it
|
||||||
;; extensible?)
|
;; extensible?)
|
||||||
(let [args (s/conform ::defstruct-args args)]
|
(let [args (s/conform ::defstruct-args args)]
|
||||||
`(let [struct-type# [::struct [~@(->> (:fields args)
|
`(let [struct-type# [::struct ~(mapv (juxt :field-name :field-type) (:fields args))]]
|
||||||
(partition 2)
|
|
||||||
(map vector))]]]
|
|
||||||
(defmethod c-layout ~(:struct-name args)
|
(defmethod c-layout ~(:struct-name args)
|
||||||
[_type#]
|
[_type#]
|
||||||
(c-layout struct-type#))
|
(c-layout struct-type#))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue