26 lines
566 B
Scheme
26 lines
566 B
Scheme
(include stdio.h)
|
|
|
|
(defmacro (plus . rest)
|
|
`(+ ,@rest))
|
|
|
|
(struct vertex
|
|
((pos (struct ((x u32) (y u32))))
|
|
(color (struct ((r float) (g float) (b float))))
|
|
(mask u32)))
|
|
|
|
(enum
|
|
(B A R))
|
|
|
|
;;; Main entry point
|
|
;;; Multi line comments should be packed
|
|
(pub fn main () int
|
|
;; the vertex
|
|
(var a (struct vertex) #(#(10 20)
|
|
#(0.3 0.5 0.7)
|
|
(c-bit-or B A R)))
|
|
(printf "%d %f %d\n" ; the printf
|
|
(plus a.pos.x a.pos.y)
|
|
(plus a.color.r a.color.g a.color.b)
|
|
a.mask)
|
|
(return 0))
|