Files
jak-project/test/goalc/source_templates/with_game/test-static-inline-array.gc
T
water111 cadd014add [Compiler] Support array fields in static objects (#284)
* first part of static inline array fields

* level h
2021-02-25 22:49:46 -05:00

47 lines
1.4 KiB
Common Lisp

(deftype test-basic-for-static-inline (basic)
((value uint32)
(name string)
(thing symbol)
(lst pair)
)
)
(let ((test-arr (new 'static 'inline-array test-basic-for-static-inline 3
(new 'static 'test-basic-for-static-inline :value 12 :name "test-name" :thing 'beans :lst '("asdf" b ( c . d)))
(new 'static 'test-basic-for-static-inline :value 1235 :name "hello")
)
)
)
(format #t "~A ~A #x~X #x~X ~A~%"
(-> test-arr 0 type)
(-> test-arr 1 type)
(logand 15 (the int (-> test-arr 1)))
(logand 15 (the int test-arr))
(-> test-arr 1 name)
)
)
(deftype test-struct-for-static-inline (structure)
((value uint32)
(name string)
(thing symbol)
(lst pair)
)
)
(let ((test-arr (new 'static 'inline-array test-struct-for-static-inline 3
(new 'static 'test-struct-for-static-inline :value 12 :name "test-name" :thing 'beans :lst '("asdf" b ( c . d)))
(new 'static 'test-struct-for-static-inline :value 1235 :name "hello")
)
)
)
(format #t "#x~X #x~X ~A~%"
;;(-> test-arr 0 type)
;;(-> test-arr 1 type)
(logand 15 (the int (-> test-arr 1)))
(logand 15 (the int test-arr))
(-> test-arr 1 name)
)
)