11 lines
229 B
Scheme
11 lines
229 B
Scheme
(pub include stdlib.h)
|
|
|
|
(pub defmacro (mem-alloc type)
|
|
`(cast (malloc (sizeof ,type)) (* ,type)))
|
|
|
|
(pub defmacro (sum-type sum type)
|
|
(cat sum (cat 'ǂ type)))
|
|
|
|
(pub defmacro (tag-type sum-type)
|
|
`(enum ,(cat sum-type 'ǂ)))
|